nominet-epp 0.0.12 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +24 -0
- data/.travis.yml +14 -0
- data/.yardopts +8 -2
- data/Gemfile +22 -0
- data/Gemfile.lock +64 -0
- data/HISTORY.md +78 -0
- data/LICENSE +1 -1
- data/README.md +23 -0
- data/Rakefile +2 -37
- data/gemfiles/Gemfile.ruby18 +13 -0
- data/lib/nominet-epp/client.rb +364 -0
- data/lib/nominet-epp/notification.rb +346 -0
- data/lib/nominet-epp/operations.rb +2 -7
- data/lib/nominet-epp/request.rb +165 -0
- data/lib/nominet-epp/requests/contact/check.rb +9 -0
- data/lib/nominet-epp/requests/contact/create.rb +60 -0
- data/lib/nominet-epp/requests/contact/delete.rb +9 -0
- data/lib/nominet-epp/requests/contact/info.rb +9 -0
- data/lib/nominet-epp/requests/contact/release.rb +33 -0
- data/lib/nominet-epp/requests/contact/update.rb +63 -0
- data/lib/nominet-epp/requests/custom/handshake.rb +36 -0
- data/lib/nominet-epp/requests/custom/list.rb +38 -0
- data/lib/nominet-epp/requests/custom/tag_list.rb +25 -0
- data/lib/nominet-epp/requests/domain/check.rb +98 -0
- data/lib/nominet-epp/requests/domain/create.rb +97 -0
- data/lib/nominet-epp/requests/domain/delete.rb +9 -0
- data/lib/nominet-epp/requests/domain/info.rb +9 -0
- data/lib/nominet-epp/requests/domain/release.rb +33 -0
- data/lib/nominet-epp/requests/domain/renew.rb +9 -0
- data/lib/nominet-epp/requests/domain/unrenew.rb +33 -0
- data/lib/nominet-epp/requests/domain/update.rb +134 -0
- data/lib/nominet-epp/requests/host/check.rb +9 -0
- data/lib/nominet-epp/requests/host/create.rb +9 -0
- data/lib/nominet-epp/requests/host/delete.rb +9 -0
- data/lib/nominet-epp/requests/host/info.rb +9 -0
- data/lib/nominet-epp/requests/host/update.rb +9 -0
- data/lib/nominet-epp/responses/contact/check_response.rb +10 -0
- data/lib/nominet-epp/responses/contact/create_response.rb +14 -0
- data/lib/nominet-epp/responses/contact/delete_response.rb +10 -0
- data/lib/nominet-epp/responses/contact/info_response.rb +89 -0
- data/lib/nominet-epp/responses/contact/release_response.rb +10 -0
- data/lib/nominet-epp/responses/contact/update_response.rb +10 -0
- data/lib/nominet-epp/responses/custom/handshake_response.rb +33 -0
- data/lib/nominet-epp/responses/custom/list_response.rb +29 -0
- data/lib/nominet-epp/responses/custom/tag_list_response.rb +37 -0
- data/lib/nominet-epp/responses/domain/check_response.rb +40 -0
- data/lib/nominet-epp/responses/domain/create_response.rb +10 -0
- data/lib/nominet-epp/responses/domain/delete_response.rb +10 -0
- data/lib/nominet-epp/responses/domain/info_response.rb +128 -0
- data/lib/nominet-epp/responses/domain/release_response.rb +10 -0
- data/lib/nominet-epp/responses/domain/renew_response.rb +10 -0
- data/lib/nominet-epp/responses/domain/unrenew_response.rb +26 -0
- data/lib/nominet-epp/responses/domain/update_response.rb +10 -0
- data/lib/nominet-epp/responses/host/check_response.rb +10 -0
- data/lib/nominet-epp/responses/host/create_response.rb +14 -0
- data/lib/nominet-epp/responses/host/delete_response.rb +10 -0
- data/lib/nominet-epp/responses/host/info_response.rb +14 -0
- data/lib/nominet-epp/responses/host/update_response.rb +10 -0
- data/lib/nominet-epp/responses/response.rb +27 -0
- data/lib/nominet-epp/version.rb +4 -0
- data/lib/nominet-epp.rb +60 -161
- data/nominet-epp.gemspec +15 -65
- data/test/helper.rb +57 -0
- data/test/notifications/test_contact_deleted_notification.rb +23 -0
- data/test/notifications/test_domain_cancelled_notification.rb +23 -0
- data/test/notifications/test_domains_released_notification.rb +34 -0
- data/test/notifications/test_domains_suspended_notification.rb +30 -0
- data/test/notifications/test_handshake_rejected_notification.rb +34 -0
- data/test/notifications/test_registrant_transfer_notification.rb +78 -0
- data/test/notifications/test_registrar_change_notification.rb +119 -0
- data/test/requests/contact/test_contact_check_request.rb +25 -0
- data/test/requests/contact/test_contact_create_request.rb +104 -0
- data/test/requests/contact/test_contact_delete_request.rb +20 -0
- data/test/requests/contact/test_contact_info_request.rb +20 -0
- data/test/requests/contact/test_contact_release_request.rb +29 -0
- data/test/requests/contact/test_contact_update_request.rb +111 -0
- data/test/requests/custom/test_custom_handshake_request.rb +42 -0
- data/test/requests/custom/test_custom_list_request.rb +44 -0
- data/test/requests/custom/test_custom_tag_list_request.rb +21 -0
- data/test/requests/domain/test_domain_check_request.rb +140 -0
- data/test/requests/domain/test_domain_create_request.rb +136 -0
- data/test/requests/domain/test_domain_delete_request.rb +20 -0
- data/test/requests/domain/test_domain_info_request.rb +20 -0
- data/test/requests/domain/test_domain_release_request.rb +29 -0
- data/test/requests/domain/test_domain_renew_request.rb +15 -0
- data/test/requests/domain/test_domain_unrenew_request.rb +32 -0
- data/test/requests/domain/test_domain_update_request.rb +163 -0
- data/test/requests/host/test_host_check_request.rb +25 -0
- data/test/requests/host/test_host_create_request.rb +33 -0
- data/test/requests/host/test_host_delete_request.rb +20 -0
- data/test/requests/host/test_host_info_request.rb +20 -0
- data/test/requests/host/test_host_update_request.rb +55 -0
- data/test/responses/contact/test_contact_check_response.rb +28 -0
- data/test/responses/contact/test_contact_create_response.rb +28 -0
- data/test/responses/contact/test_contact_delete_response.rb +18 -0
- data/test/responses/contact/test_contact_info_response.rb +79 -0
- data/test/responses/contact/test_contact_release_response.rb +18 -0
- data/test/responses/contact/test_contact_update_response.rb +18 -0
- data/test/responses/custom/test_custom_handshake_response.rb +27 -0
- data/test/responses/custom/test_custom_list_response.rb +44 -0
- data/test/responses/custom/test_custom_tag_list_response.rb +43 -0
- data/test/responses/domain/test_domain_check_response.rb +56 -0
- data/test/responses/domain/test_domain_create_response.rb +34 -0
- data/test/responses/domain/test_domain_delete_response.rb +18 -0
- data/test/responses/domain/test_domain_info_response.rb +76 -0
- data/test/responses/domain/test_domain_release_response.rb +18 -0
- data/test/responses/domain/test_domain_renew_response.rb +27 -0
- data/test/responses/domain/test_domain_unrenew_response.rb +32 -0
- data/test/responses/domain/test_domain_update_response.rb +18 -0
- data/test/responses/host/test_host_check_response.rb +28 -0
- data/test/responses/host/test_host_create_response.rb +28 -0
- data/test/responses/host/test_host_delete_response.rb +18 -0
- data/test/responses/host/test_host_info_response.rb +28 -0
- data/test/responses/host/test_host_update_response.rb +18 -0
- data/test/support/responses/contact/check.xml +23 -0
- data/test/support/responses/contact/create.xml +23 -0
- data/test/support/responses/contact/delete.xml +12 -0
- data/test/support/responses/contact/info.xml +46 -0
- data/test/support/responses/contact/release.xml +12 -0
- data/test/support/responses/contact/update.xml +12 -0
- data/test/support/responses/custom/handshake.xml +24 -0
- data/test/support/responses/custom/list.xml +28 -0
- data/test/support/responses/custom/list_empty.xml +21 -0
- data/test/support/responses/custom/tag_list.xml +28 -0
- data/test/support/responses/domain/check-direct-rights.xml +1 -0
- data/test/support/responses/domain/check.xml +25 -0
- data/test/support/responses/domain/create.xml +24 -0
- data/test/support/responses/domain/delete.xml +12 -0
- data/test/support/responses/domain/info.xml +45 -0
- data/test/support/responses/domain/release.xml +12 -0
- data/test/support/responses/domain/renew.xml +24 -0
- data/test/support/responses/domain/unrenew.xml +26 -0
- data/test/support/responses/domain/update.xml +12 -0
- data/test/support/responses/host/check.xml +23 -0
- data/test/support/responses/host/create.xml +18 -0
- data/test/support/responses/host/delete.xml +12 -0
- data/test/support/responses/host/info.xml +25 -0
- data/test/support/responses/host/update.xml +12 -0
- data/test/support/responses/notifications/abuse-feed.xml +31 -0
- data/test/support/responses/notifications/account-change.xml +39 -0
- data/test/support/responses/notifications/contact-deleted.xml +22 -0
- data/test/support/responses/notifications/data-quality.xml +53 -0
- data/test/support/responses/notifications/domain-cancelled.xml +22 -0
- data/test/support/responses/notifications/domains-released.xml +31 -0
- data/test/support/responses/notifications/domains-suspended.xml +26 -0
- data/test/support/responses/notifications/handshake-rejected.xml +31 -0
- data/test/support/responses/notifications/handshake-request.xml +65 -0
- data/test/support/responses/notifications/hosts-cancelled.xml +28 -0
- data/test/support/responses/notifications/referral-accepted.xml +23 -0
- data/test/support/responses/notifications/referral-rejected.xml +22 -0
- data/test/support/responses/notifications/registrant-transfer.xml +54 -0
- data/test/support/responses/notifications/registrar-change.xml +67 -0
- data/test/support/schemas/README +12 -0
- data/test/support/schemas/RELEASENOTES +54 -0
- data/test/support/schemas/contact-1.0.xsd +387 -0
- data/test/support/schemas/contact-nom-ext-1.0.xsd +144 -0
- data/test/support/schemas/domain-1.0.xsd +432 -0
- data/test/support/schemas/domain-nom-ext-1.2.xsd +215 -0
- data/test/support/schemas/epp-1.0.xsd +403 -0
- data/test/support/schemas/eppcom-1.0.xsd +93 -0
- data/test/support/schemas/host-1.0.xsd +240 -0
- data/test/support/schemas/nom-abuse-feed-1.0.xsd +46 -0
- data/test/support/schemas/nom-direct-rights-1.0.xsd +48 -0
- data/test/support/schemas/nom-root-std-1.0.7.xsd +47 -0
- data/test/support/schemas/nom-root-tag-1.0.xsd +31 -0
- data/test/support/schemas/nom-tag-1.0.xsd +71 -0
- data/test/support/schemas/secDNS-1.1.xsd +127 -0
- data/test/support/schemas/std-contact-id-1.0.xsd +35 -0
- data/test/support/schemas/std-fork-1.0.xsd +31 -0
- data/test/support/schemas/std-handshake-1.0.xsd +61 -0
- data/test/support/schemas/std-list-1.0.xsd +55 -0
- data/test/support/schemas/std-locks-1.0.xsd +53 -0
- data/test/support/schemas/std-notifications-1.2.xsd +197 -0
- data/test/support/schemas/std-release-1.0.xsd +39 -0
- data/test/support/schemas/std-unrenew-1.0.xsd +26 -0
- data/test/support/schemas/std-warning-1.1.xsd +145 -0
- data/test/test_nominet-epp.rb +3 -3
- metadata +324 -104
- data/History.rdoc +0 -78
- data/README.rdoc +0 -23
- data/VERSION +0 -1
- data/lib/nominet-epp/operations/check.rb +0 -39
- data/lib/nominet-epp/operations/create.rb +0 -138
- data/lib/nominet-epp/operations/delete.rb +0 -20
- data/lib/nominet-epp/operations/fork.rb +0 -53
- data/lib/nominet-epp/operations/hello.rb +0 -11
- data/lib/nominet-epp/operations/info.rb +0 -93
- data/lib/nominet-epp/operations/list.rb +0 -83
- data/lib/nominet-epp/operations/lock.rb +0 -56
- data/lib/nominet-epp/operations/merge.rb +0 -41
- data/lib/nominet-epp/operations/poll.rb +0 -64
- data/lib/nominet-epp/operations/renew.rb +0 -40
- data/lib/nominet-epp/operations/transfer.rb +0 -84
- data/lib/nominet-epp/operations/unlock.rb +0 -56
- data/lib/nominet-epp/operations/unrenew.rb +0 -36
- data/lib/nominet-epp/operations/update.rb +0 -176
@@ -0,0 +1,136 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetDomainCreateRequest < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Domain::Create' do
|
5
|
+
context 'no extensions' do
|
6
|
+
setup do
|
7
|
+
@time = Time.now.utc
|
8
|
+
@request = NominetEPP::Domain::Create.new('example.co.uk',
|
9
|
+
:period => '2y', :registrant => 'UK-2349723',
|
10
|
+
:nameservers => %w(ns1.test.host ns2.test.host),
|
11
|
+
:auth_info => {:pw => '2381728348'})
|
12
|
+
@xml = prepare_request.to_xml
|
13
|
+
|
14
|
+
namespaces_from_request
|
15
|
+
end
|
16
|
+
|
17
|
+
should 'validate against schema' do
|
18
|
+
assert @xml.validate_schema(schema)
|
19
|
+
end
|
20
|
+
|
21
|
+
should 'have create element' do
|
22
|
+
assert xpath_exists?('//domain:create'), "should have create element"
|
23
|
+
end
|
24
|
+
|
25
|
+
should 'have name element' do
|
26
|
+
assert_equal 'example.co.uk', xpath_find('//domain:name')
|
27
|
+
end
|
28
|
+
|
29
|
+
should 'not have extension element' do
|
30
|
+
assert !xpath_exists?('//epp:extension'), "should not have extension element"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
context 'nominet extensions' do
|
34
|
+
setup do
|
35
|
+
@time = Time.now.utc
|
36
|
+
@request = NominetEPP::Domain::Create.new('example.co.uk',
|
37
|
+
:period => '2y', :registrant => 'UK-2349723',
|
38
|
+
:nameservers => %w(ns1.test.host ns2.test.host),
|
39
|
+
:auth_info => {:pw => '2381728348'},
|
40
|
+
:first_bill => 'th', :recur_bill => 'th', :auto_bill => 1)
|
41
|
+
@xml = prepare_request.to_xml
|
42
|
+
|
43
|
+
namespaces_from_request
|
44
|
+
end
|
45
|
+
|
46
|
+
should 'validate against schema' do
|
47
|
+
assert @xml.validate_schema(schema)
|
48
|
+
end
|
49
|
+
|
50
|
+
should 'have domain extension element' do
|
51
|
+
assert xpath_exists?('//domain-ext:create'), "should have extension create element"
|
52
|
+
end
|
53
|
+
should 'have first-bill element' do
|
54
|
+
assert_equal 'th', xpath_find('//domain-ext:first-bill')
|
55
|
+
end
|
56
|
+
should 'have recur-bill element' do
|
57
|
+
assert_equal 'th', xpath_find('//domain-ext:recur-bill')
|
58
|
+
end
|
59
|
+
should 'have auto-bill element' do
|
60
|
+
assert_equal '1', xpath_find('//domain-ext:auto-bill')
|
61
|
+
end
|
62
|
+
|
63
|
+
should 'not have secDNS extension' do
|
64
|
+
assert !xpath_exists?('//create[namespace-uri()="urn:ietf:params:xml:ns:secDNS-1.1"]'), "should not have secDNS extension"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
context 'dnssec extensions' do
|
68
|
+
setup do
|
69
|
+
@time = Time.now.utc
|
70
|
+
@request = NominetEPP::Domain::Create.new('example.co.uk',
|
71
|
+
:period => '2y', :registrant => 'UK-2349723',
|
72
|
+
:nameservers => %w(ns1.test.host ns2.test.host),
|
73
|
+
:auth_info => {:pw => '2381728348'},
|
74
|
+
:ds => [{
|
75
|
+
:key_tag => 37102, :alg => 5, :digest_type => 1,
|
76
|
+
:digest => "C9E29CA7712DCAD2D93B49774F7EFF30E54E9EC5" }])
|
77
|
+
@xml = prepare_request.to_xml
|
78
|
+
|
79
|
+
namespaces_from_request
|
80
|
+
end
|
81
|
+
|
82
|
+
should 'validate against schema' do
|
83
|
+
assert @xml.validate_schema(schema)
|
84
|
+
end
|
85
|
+
|
86
|
+
should 'have DNSSEC extension element' do
|
87
|
+
assert xpath_exists?('//secDNS:create'), "should have DNSSEC extension element"
|
88
|
+
end
|
89
|
+
should 'have keyTag' do
|
90
|
+
assert_equal '37102', xpath_find('//secDNS:keyTag')
|
91
|
+
end
|
92
|
+
should 'have alg' do
|
93
|
+
assert_equal '5', xpath_find('//secDNS:alg')
|
94
|
+
end
|
95
|
+
should 'have digestType' do
|
96
|
+
assert_equal '1', xpath_find('//secDNS:digestType')
|
97
|
+
end
|
98
|
+
should 'have digest' do
|
99
|
+
expected = "C9E29CA7712DCAD2D93B49774F7EFF30E54E9EC5"
|
100
|
+
assert_equal expected, xpath_find('//secDNS:digest')
|
101
|
+
end
|
102
|
+
|
103
|
+
should 'not have domain-ext extension' do
|
104
|
+
assert !xpath_exists?('//create[namespace-uri()="http://www.nominet.org.uk/epp/xml/domain-nom-ext-1.2"]'), "should not have domain-ext extension"
|
105
|
+
end
|
106
|
+
end
|
107
|
+
context 'all extensions' do
|
108
|
+
setup do
|
109
|
+
@time = Time.now.utc
|
110
|
+
@request = NominetEPP::Domain::Create.new('example.co.uk',
|
111
|
+
:period => '2y', :registrant => 'UK-2349723',
|
112
|
+
:nameservers => %w(ns1.test.host ns2.test.host),
|
113
|
+
:auth_info => {:pw => '2381728348'},
|
114
|
+
:first_bill => 'th', :recur_bill => 'th', :auto_bill => 1,
|
115
|
+
:ds => [{
|
116
|
+
:key_tag => 37102, :alg => 5, :digest_type => 1,
|
117
|
+
:digest => "C9E29CA7712DCAD2D93B49774F7EFF30E54E9EC5" }])
|
118
|
+
@xml = prepare_request.to_xml
|
119
|
+
|
120
|
+
namespaces_from_request
|
121
|
+
end
|
122
|
+
|
123
|
+
should 'validate against schema' do
|
124
|
+
assert @xml.validate_schema(schema)
|
125
|
+
end
|
126
|
+
|
127
|
+
should 'have domain extension element' do
|
128
|
+
assert xpath_exists?('//domain-ext:create'), "should have extension create element"
|
129
|
+
end
|
130
|
+
|
131
|
+
should 'have DNSSEC extension element' do
|
132
|
+
assert xpath_exists?('//secDNS:create'), "should have DNSSEC extension element"
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetDomainDeleteRequest < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Domain::Delete' do
|
5
|
+
setup do
|
6
|
+
@request = NominetEPP::Domain::Delete.new('example.co.uk')
|
7
|
+
@xml = prepare_request.to_xml
|
8
|
+
|
9
|
+
namespaces_from_request
|
10
|
+
end
|
11
|
+
|
12
|
+
should 'validate against schema' do
|
13
|
+
assert @xml.validate_schema(schema)
|
14
|
+
end
|
15
|
+
|
16
|
+
should 'have name' do
|
17
|
+
assert_equal 'example.co.uk', xpath_find('//domain:name')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetDomainInfoRequest < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Domain::Info' do
|
5
|
+
setup do
|
6
|
+
@request = NominetEPP::Domain::Info.new('example.co.uk')
|
7
|
+
@xml = prepare_request.to_xml
|
8
|
+
|
9
|
+
namespaces_from_request
|
10
|
+
end
|
11
|
+
|
12
|
+
should 'validate against schema' do
|
13
|
+
assert @xml.validate_schema(schema)
|
14
|
+
end
|
15
|
+
|
16
|
+
should 'have name' do
|
17
|
+
assert_equal 'example.co.uk', xpath_find('//domain:name')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetDomainReleaseRequest < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Domain::Release' do
|
5
|
+
setup do
|
6
|
+
@time = Time.now.utc
|
7
|
+
@request = NominetEPP::Domain::Release.new('example.co.uk', 'TESTING')
|
8
|
+
@xml = prepare_request.to_xml
|
9
|
+
|
10
|
+
namespaces_from_request
|
11
|
+
end
|
12
|
+
|
13
|
+
should 'validate against schema' do
|
14
|
+
assert @xml.validate_schema(schema)
|
15
|
+
end
|
16
|
+
|
17
|
+
should 'have release element' do
|
18
|
+
assert xpath_exists?('//r:release'), "should have release element"
|
19
|
+
end
|
20
|
+
|
21
|
+
should 'have domainName element' do
|
22
|
+
assert_equal 'example.co.uk', xpath_find('//r:domainName')
|
23
|
+
end
|
24
|
+
|
25
|
+
should 'have registrarTag element' do
|
26
|
+
assert_equal 'TESTING', xpath_find('//r:registrarTag')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetDomainRenewRequest < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Domain::Renew' do
|
5
|
+
setup do
|
6
|
+
@time = Time.now.utc
|
7
|
+
@request = NominetEPP::Domain::Renew.new('example.co.uk', @time, '2y')
|
8
|
+
@xml = prepare_request.to_xml
|
9
|
+
end
|
10
|
+
|
11
|
+
should 'validate against schema' do
|
12
|
+
assert @xml.validate_schema(schema)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetDomainUnrenewRequest < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Domain::Unrenew' do
|
5
|
+
setup do
|
6
|
+
@time = Time.now.utc
|
7
|
+
@request = NominetEPP::Domain::Unrenew.new('example.co.uk', 'example.me.uk')
|
8
|
+
@xml = prepare_request.to_xml
|
9
|
+
|
10
|
+
namespaces_from_request
|
11
|
+
end
|
12
|
+
|
13
|
+
should 'validate against schema' do
|
14
|
+
assert @xml.validate_schema(schema)
|
15
|
+
end
|
16
|
+
|
17
|
+
should 'have unrenew element' do
|
18
|
+
assert xpath_exists?('//u:unrenew'), "should have unrenew element"
|
19
|
+
end
|
20
|
+
|
21
|
+
should 'have domainName elements' do
|
22
|
+
expected = ['example.co.uk', 'example.me.uk']
|
23
|
+
actual = []
|
24
|
+
|
25
|
+
xpath_each('//u:domainName') do |node|
|
26
|
+
actual << node.content.strip
|
27
|
+
end
|
28
|
+
|
29
|
+
assert_equal expected, actual
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,163 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetDomainUpdateRequest < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Domain::Update' do
|
5
|
+
context 'no extensions' do
|
6
|
+
setup do
|
7
|
+
@time = Time.now.utc
|
8
|
+
@request = NominetEPP::Domain::Update.new('example.co.uk',
|
9
|
+
:add => {:ns => %w(ns1.test.host ns2.test.host)},
|
10
|
+
:rem => {:ns => %w(ns3.test.host ns4.test.host)},
|
11
|
+
:chg => {:registrant => 'UK-2349723'})
|
12
|
+
@xml = prepare_request.to_xml
|
13
|
+
|
14
|
+
namespaces_from_request
|
15
|
+
end
|
16
|
+
|
17
|
+
should 'validate against schema' do
|
18
|
+
assert @xml.validate_schema(schema)
|
19
|
+
end
|
20
|
+
|
21
|
+
should 'have update element' do
|
22
|
+
assert xpath_exists?('//domain:update'), "should have update element"
|
23
|
+
end
|
24
|
+
|
25
|
+
should 'have name element' do
|
26
|
+
assert_equal 'example.co.uk', xpath_find('//domain:name')
|
27
|
+
end
|
28
|
+
|
29
|
+
should 'not have extension element' do
|
30
|
+
assert !xpath_exists?('//epp:extension'), "should not have extension element"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
context 'nominet extensions' do
|
34
|
+
setup do
|
35
|
+
@time = Time.now.utc
|
36
|
+
@request = NominetEPP::Domain::Update.new('example.co.uk',
|
37
|
+
:add => {:renew_not_required => true},
|
38
|
+
:chg => {:first_bill => 'th', :auto_bill => 1})
|
39
|
+
@xml = prepare_request.to_xml
|
40
|
+
|
41
|
+
namespaces_from_request
|
42
|
+
end
|
43
|
+
|
44
|
+
should 'validate against schema' do
|
45
|
+
assert @xml.validate_schema(schema)
|
46
|
+
end
|
47
|
+
|
48
|
+
should 'have update element' do
|
49
|
+
assert xpath_exists?('//domain:update'), "should have update element"
|
50
|
+
end
|
51
|
+
|
52
|
+
should 'have name element' do
|
53
|
+
assert_equal 'example.co.uk', xpath_find('//domain:name')
|
54
|
+
end
|
55
|
+
|
56
|
+
should 'have domain extension element' do
|
57
|
+
assert xpath_exists?('//domain-ext:update'), "should have extension update element"
|
58
|
+
end
|
59
|
+
should 'have changed first-bill element' do
|
60
|
+
assert_equal 'th', xpath_find('//domain-ext:first-bill')
|
61
|
+
end
|
62
|
+
should 'have changed auto-bill element' do
|
63
|
+
assert_equal '1', xpath_find('//domain-ext:auto-bill')
|
64
|
+
end
|
65
|
+
should 'have added renew-not-required element' do
|
66
|
+
assert_equal 'Y', xpath_find('//domain-ext:renew-not-required')
|
67
|
+
end
|
68
|
+
|
69
|
+
should 'not have secDNS extension' do
|
70
|
+
assert !xpath_exists?('//update[namespace-uri()="urn:ietf:params:xml:ns:secDNS-1.1"]'),
|
71
|
+
"should not have secDNS extension"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
context 'dnssec extensions' do
|
75
|
+
setup do
|
76
|
+
@time = Time.now.utc
|
77
|
+
@request = NominetEPP::Domain::Update.new('example.co.uk',
|
78
|
+
:add => {:ds => [{
|
79
|
+
:key_tag => 37102, :alg => 5, :digest_type => 1,
|
80
|
+
:digest => "C9E29CA7712DCAD2D93B49774F7EFF30E54E9EC5" }]},
|
81
|
+
:rem => {:ds => [{
|
82
|
+
:key_tag => 37105, :alg => 5, :digest_type => 1,
|
83
|
+
:digest => "C9E29CA7712DCAD2D93B49774F7EFF30E54E9EC57E57" }]})
|
84
|
+
@xml = prepare_request.to_xml
|
85
|
+
|
86
|
+
namespaces_from_request
|
87
|
+
end
|
88
|
+
|
89
|
+
should 'validate against schema' do
|
90
|
+
assert @xml.validate_schema(schema)
|
91
|
+
end
|
92
|
+
|
93
|
+
should 'have DNSSEC extension element' do
|
94
|
+
assert xpath_exists?('//secDNS:update'), "should have DNSSEC extension element"
|
95
|
+
end
|
96
|
+
should 'have add keyTag' do
|
97
|
+
assert_equal '37102', xpath_find('//secDNS:add/secDNS:dsData/secDNS:keyTag')
|
98
|
+
end
|
99
|
+
should 'have add alg' do
|
100
|
+
assert_equal '5', xpath_find('//secDNS:add/secDNS:dsData/secDNS:alg')
|
101
|
+
end
|
102
|
+
should 'have add digestType' do
|
103
|
+
assert_equal '1', xpath_find('//secDNS:add/secDNS:dsData/secDNS:digestType')
|
104
|
+
end
|
105
|
+
should 'have add digest' do
|
106
|
+
expected = "C9E29CA7712DCAD2D93B49774F7EFF30E54E9EC5"
|
107
|
+
assert_equal expected, xpath_find('//secDNS:add/secDNS:dsData/secDNS:digest')
|
108
|
+
end
|
109
|
+
should 'have rem keyTag' do
|
110
|
+
assert_equal '37105', xpath_find('//secDNS:rem/secDNS:dsData/secDNS:keyTag')
|
111
|
+
end
|
112
|
+
should 'have rem alg' do
|
113
|
+
assert_equal '5', xpath_find('//secDNS:rem/secDNS:dsData/secDNS:alg')
|
114
|
+
end
|
115
|
+
should 'have rem digestType' do
|
116
|
+
assert_equal '1', xpath_find('//secDNS:rem/secDNS:dsData/secDNS:digestType')
|
117
|
+
end
|
118
|
+
should 'have rem digest' do
|
119
|
+
expected = "C9E29CA7712DCAD2D93B49774F7EFF30E54E9EC57E57"
|
120
|
+
assert_equal expected, xpath_find('//secDNS:rem/secDNS:dsData/secDNS:digest')
|
121
|
+
end
|
122
|
+
|
123
|
+
should 'not have domain-ext extension' do
|
124
|
+
assert !xpath_exists?('//create[namespace-uri()="http://www.nominet.org.uk/epp/xml/domain-nom-ext-1.2"]'), "should not have domain-ext extension"
|
125
|
+
end
|
126
|
+
end
|
127
|
+
context 'all extensions' do
|
128
|
+
setup do
|
129
|
+
@time = Time.now.utc
|
130
|
+
@request = NominetEPP::Domain::Update.new('example.co.uk',
|
131
|
+
:add => {
|
132
|
+
:renew_not_required => true,
|
133
|
+
:ns => %w(ns1.test.host ns2.test.host),
|
134
|
+
:ds => [{
|
135
|
+
:key_tag => 37102, :alg => 5, :digest_type => 1,
|
136
|
+
:digest => "C9E29CA7712DCAD2D93B49774F7EFF30E54E9EC5" }]},
|
137
|
+
:chg => {
|
138
|
+
:registrant => 'UK-2349723',
|
139
|
+
:first_bill => 'th', :auto_bill => 1},
|
140
|
+
:rem => {
|
141
|
+
:ns => %w(ns3.test.host ns4.test.host),
|
142
|
+
:ds => [{
|
143
|
+
:key_tag => 37105, :alg => 5, :digest_type => 1,
|
144
|
+
:digest => "C9E29CA7712DCAD2D93B49774F7EFF30E54E9EC57E57" }]})
|
145
|
+
@xml = prepare_request.to_xml
|
146
|
+
|
147
|
+
namespaces_from_request
|
148
|
+
end
|
149
|
+
|
150
|
+
should 'validate against schema' do
|
151
|
+
assert @xml.validate_schema(schema)
|
152
|
+
end
|
153
|
+
|
154
|
+
should 'have domain extension element' do
|
155
|
+
assert xpath_exists?('//domain-ext:update'), "should have extension update element"
|
156
|
+
end
|
157
|
+
|
158
|
+
should 'have DNSSEC extension element' do
|
159
|
+
assert xpath_exists?('//secDNS:update'), "should have DNSSEC extension element"
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetHostCheckRequest < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Host::Check' do
|
5
|
+
setup do
|
6
|
+
@request = NominetEPP::Host::Check.new('ns1.example.co.uk', 'ns2.example.me.uk')
|
7
|
+
@xml = prepare_request.to_xml
|
8
|
+
|
9
|
+
namespaces_from_request
|
10
|
+
end
|
11
|
+
|
12
|
+
should 'validate against schema' do
|
13
|
+
assert @xml.validate_schema(schema)
|
14
|
+
end
|
15
|
+
|
16
|
+
should 'include names' do
|
17
|
+
names = []
|
18
|
+
xpath_each('//host:name') do |node|
|
19
|
+
names << node.content.strip
|
20
|
+
end
|
21
|
+
|
22
|
+
assert_equal ['ns1.example.co.uk', 'ns2.example.me.uk'], names
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetHostCreateRequest < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Host::Create' do
|
5
|
+
setup do
|
6
|
+
@request = NominetEPP::Host::Create.new('ns1.example.co.uk',
|
7
|
+
:ipv4 => "198.51.100.53", :ipv6 => "2001:db8::53:1")
|
8
|
+
@xml = prepare_request.to_xml
|
9
|
+
|
10
|
+
namespaces_from_request
|
11
|
+
end
|
12
|
+
|
13
|
+
should 'validate against schema' do
|
14
|
+
assert @xml.validate_schema(schema)
|
15
|
+
end
|
16
|
+
|
17
|
+
should 'set name' do
|
18
|
+
assert_equal 'ns1.example.co.uk', xpath_find('//host:name')
|
19
|
+
end
|
20
|
+
|
21
|
+
should 'set IPv4 address' do
|
22
|
+
assert_equal "198.51.100.53", xpath_find('//host:addr[@ip="v4"]')
|
23
|
+
end
|
24
|
+
|
25
|
+
should 'set IPv6 address' do
|
26
|
+
assert_equal "2001:db8::53:1", xpath_find('//host:addr[@ip="v6"]')
|
27
|
+
end
|
28
|
+
|
29
|
+
should 'not have extension element' do
|
30
|
+
assert !xpath_exists?('//epp:extension'), "should not have extension element"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetHostDeleteRequest < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Host::Delete' do
|
5
|
+
setup do
|
6
|
+
@request = NominetEPP::Host::Delete.new('ns1.example.co.uk')
|
7
|
+
@xml = prepare_request.to_xml
|
8
|
+
|
9
|
+
namespaces_from_request
|
10
|
+
end
|
11
|
+
|
12
|
+
should 'validate against schema' do
|
13
|
+
assert @xml.validate_schema(schema)
|
14
|
+
end
|
15
|
+
|
16
|
+
should 'have name' do
|
17
|
+
assert_equal 'ns1.example.co.uk', xpath_find('//host:name')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetHostInfoRequest < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Host::Info' do
|
5
|
+
setup do
|
6
|
+
@request = NominetEPP::Host::Info.new('ns1.example.co.uk')
|
7
|
+
@xml = prepare_request.to_xml
|
8
|
+
|
9
|
+
namespaces_from_request
|
10
|
+
end
|
11
|
+
|
12
|
+
should 'validate against schema' do
|
13
|
+
assert @xml.validate_schema(schema)
|
14
|
+
end
|
15
|
+
|
16
|
+
should 'have name' do
|
17
|
+
assert_equal 'ns1.example.co.uk', xpath_find('//host:name')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetHostUpdateRequest < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Host::Update' do
|
5
|
+
setup do
|
6
|
+
@time = Time.now.utc
|
7
|
+
@request = NominetEPP::Host::Update.new('ns1.example.co.uk',
|
8
|
+
:add => {
|
9
|
+
:addr => {:ipv4 => "198.51.100.53", :ipv6 => "2001:db8::53:1"}},
|
10
|
+
:rem => {
|
11
|
+
:addr => {:ipv4 => "198.51.100.54", :ipv6 => "2001:db8::53:2"}},
|
12
|
+
:chg => {
|
13
|
+
:name => "ns2.example.co.uk" })
|
14
|
+
@xml = prepare_request.to_xml
|
15
|
+
|
16
|
+
namespaces_from_request
|
17
|
+
end
|
18
|
+
|
19
|
+
should 'validate against schema' do
|
20
|
+
assert @xml.validate_schema(schema)
|
21
|
+
end
|
22
|
+
|
23
|
+
should 'have update element' do
|
24
|
+
assert xpath_exists?('//host:update'), "should have update element"
|
25
|
+
end
|
26
|
+
|
27
|
+
should 'have name element' do
|
28
|
+
assert_equal 'ns1.example.co.uk', xpath_find('//host:name')
|
29
|
+
end
|
30
|
+
|
31
|
+
should 'add IPv4 address' do
|
32
|
+
assert_equal "198.51.100.53", xpath_find('//host:add/host:addr[@ip="v4"]')
|
33
|
+
end
|
34
|
+
|
35
|
+
should 'add IPv6 address' do
|
36
|
+
assert_equal "2001:db8::53:1", xpath_find('//host:add/host:addr[@ip="v6"]')
|
37
|
+
end
|
38
|
+
|
39
|
+
should 'remove IPv4 address' do
|
40
|
+
assert_equal "198.51.100.54", xpath_find('//host:rem/host:addr[@ip="v4"]')
|
41
|
+
end
|
42
|
+
|
43
|
+
should 'remove IPv6 address' do
|
44
|
+
assert_equal "2001:db8::53:2", xpath_find('//host:rem/host:addr[@ip="v6"]')
|
45
|
+
end
|
46
|
+
|
47
|
+
should 'change name' do
|
48
|
+
assert_equal 'ns2.example.co.uk', xpath_find('//host:chg/host:name')
|
49
|
+
end
|
50
|
+
|
51
|
+
should 'not have extension element' do
|
52
|
+
assert !xpath_exists?('//epp:extension'), "should not have extension element"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetContactCheckResponse < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Contact::Check' do
|
5
|
+
setup do
|
6
|
+
@check_response = NominetEPP::Contact::CheckResponse.new(load_response('contact/check'))
|
7
|
+
end
|
8
|
+
|
9
|
+
should 'be successful' do
|
10
|
+
assert @check_response.success?
|
11
|
+
assert_equal 1000, @check_response.code
|
12
|
+
end
|
13
|
+
|
14
|
+
should 'have message' do
|
15
|
+
assert_equal 'Command completed successfully', @check_response.message
|
16
|
+
end
|
17
|
+
|
18
|
+
should 'list ioefwurfoveyrf9e as available' do
|
19
|
+
assert @check_response.available?('ioefwurfoveyrf9e')
|
20
|
+
assert !@check_response.unavailable?('ioefwurfoveyrf9e')
|
21
|
+
end
|
22
|
+
|
23
|
+
should 'list EAXXMK1FW0YZTABD as unavailable' do
|
24
|
+
assert @check_response.unavailable?('EAXXMK1FW0YZTABD')
|
25
|
+
assert !@check_response.available?('EAXXMK1FW0YZTABD')
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetContactCreateResponse < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Contact::Create' do
|
5
|
+
setup do
|
6
|
+
@create_response = NominetEPP::Contact::CreateResponse.new(load_response('contact/create'))
|
7
|
+
end
|
8
|
+
|
9
|
+
should 'be successful' do
|
10
|
+
assert @create_response.success?
|
11
|
+
assert_equal 1000, @create_response.code
|
12
|
+
end
|
13
|
+
|
14
|
+
should 'have message' do
|
15
|
+
assert_equal 'Command completed successfully', @create_response.message
|
16
|
+
end
|
17
|
+
|
18
|
+
should 'have name UK-4398495' do
|
19
|
+
assert_equal 'UK-4398495', @create_response.name
|
20
|
+
end
|
21
|
+
|
22
|
+
should 'have new creation date' do
|
23
|
+
# 2013-09-13T15:48:52 - local time, not UTC
|
24
|
+
expected = Time.mktime(2013,9,13,15,48,52)
|
25
|
+
assert_equal expected, @create_response.creation_date
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestNominetContactDeleteResponse < Test::Unit::TestCase
|
4
|
+
context 'NominetEPP::Contact::Delete' do
|
5
|
+
setup do
|
6
|
+
@delete_response = NominetEPP::Contact::DeleteResponse.new(load_response('contact/delete'))
|
7
|
+
end
|
8
|
+
|
9
|
+
should 'be successful' do
|
10
|
+
assert @delete_response.success?
|
11
|
+
assert_equal 1000, @delete_response.code
|
12
|
+
end
|
13
|
+
|
14
|
+
should 'have message' do
|
15
|
+
assert_equal 'Command completed successfully', @delete_response.message
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|