lumberg 1.0.1 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +1 -1
- data/README.md +184 -70
- data/Rakefile +3 -1
- data/lib/lumberg/config.rb +19 -0
- data/lib/lumberg/cpanel/addon_domain.rb +50 -0
- data/lib/lumberg/cpanel/backups.rb +16 -0
- data/lib/lumberg/cpanel/base.rb +56 -0
- data/lib/lumberg/cpanel/box_trapper.rb +18 -0
- data/lib/lumberg/cpanel/branding.rb +89 -0
- data/lib/lumberg/cpanel/contact.rb +38 -0
- data/lib/lumberg/cpanel/cron.rb +89 -0
- data/lib/lumberg/cpanel/dns_lookup.rb +23 -0
- data/lib/lumberg/cpanel/domain_keys.rb +37 -0
- data/lib/lumberg/cpanel/domain_lookup.rb +71 -0
- data/lib/lumberg/cpanel/email.rb +522 -0
- data/lib/lumberg/cpanel/file_manager.rb +146 -0
- data/lib/lumberg/cpanel/ftp.rb +101 -0
- data/lib/lumberg/cpanel/gpg.rb +36 -0
- data/lib/lumberg/cpanel/locale.rb +15 -0
- data/lib/lumberg/cpanel/mime.rb +34 -0
- data/lib/lumberg/cpanel/mysql.rb +66 -0
- data/lib/lumberg/cpanel/mysql_db.rb +190 -0
- data/lib/lumberg/cpanel/net.rb +28 -0
- data/lib/lumberg/cpanel/park.rb +58 -0
- data/lib/lumberg/cpanel/password.rb +52 -0
- data/lib/lumberg/cpanel/password_strength.rb +63 -0
- data/lib/lumberg/cpanel/random_data.rb +25 -0
- data/lib/lumberg/cpanel/redirect.rb +44 -0
- data/lib/lumberg/cpanel/ssl.rb +220 -0
- data/lib/lumberg/cpanel/sub_domain.rb +61 -0
- data/lib/lumberg/cpanel/support.rb +29 -0
- data/lib/lumberg/cpanel/zone_edit.rb +134 -0
- data/lib/lumberg/cpanel.rb +32 -0
- data/lib/lumberg/format_whm.rb +162 -0
- data/lib/lumberg/version.rb +1 -1
- data/lib/lumberg/whm/account.rb +29 -106
- data/lib/lumberg/whm/base.rb +3 -7
- data/lib/lumberg/whm/cert.rb +88 -0
- data/lib/lumberg/whm/dns.rb +49 -77
- data/lib/lumberg/whm/reseller.rb +25 -118
- data/lib/lumberg/whm/server.rb +163 -222
- data/lib/lumberg/whm/transfer_tool.rb +165 -0
- data/lib/lumberg/whm.rb +11 -9
- data/lib/lumberg/whostmgr/base.rb +13 -0
- data/lib/lumberg/whostmgr/ssl.rb +57 -0
- data/lib/lumberg/whostmgr.rb +6 -0
- data/lib/lumberg.rb +35 -8
- data/spec/config_spec.rb +28 -0
- data/spec/cpanel/addon_domain_spec.rb +84 -0
- data/spec/cpanel/backups_spec.rb +22 -0
- data/spec/cpanel/base_spec.rb +128 -0
- data/spec/cpanel/box_trapper_spec.rb +22 -0
- data/spec/cpanel/branding_spec.rb +46 -0
- data/spec/cpanel/contact_spec.rb +50 -0
- data/spec/cpanel/cron_spec.rb +161 -0
- data/spec/cpanel/dns_lookup_spec.rb +22 -0
- data/spec/cpanel/domain_keys_spec.rb +46 -0
- data/spec/cpanel/domain_lookup_spec.rb +77 -0
- data/spec/cpanel/email_spec.rb +639 -0
- data/spec/cpanel/file_manager_spec.rb +73 -0
- data/spec/cpanel/ftp_spec.rb +71 -0
- data/spec/cpanel/gpg_spec.rb +48 -0
- data/spec/cpanel/locale_spec.rb +23 -0
- data/spec/cpanel/mime_spec.rb +0 -0
- data/spec/cpanel/mysql_db_spec.rb +119 -0
- data/spec/cpanel/mysql_spec.rb +0 -0
- data/spec/cpanel/net_spec.rb +30 -0
- data/spec/cpanel/park_spec.rb +94 -0
- data/spec/cpanel/password_spec.rb +35 -0
- data/spec/cpanel/password_strength_spec.rb +50 -0
- data/spec/cpanel/random_data_spec.rb +24 -0
- data/spec/cpanel/redirect_spec.rb +0 -0
- data/spec/cpanel/ssl_spec.rb +158 -0
- data/spec/cpanel/sub_domain_spec.rb +72 -0
- data/spec/cpanel/support_spec.rb +38 -0
- data/spec/cpanel/zone_edit_spec.rb +0 -0
- data/spec/format_whm_spec.rb +53 -0
- data/spec/sample_certs/cpanel.crt +28 -0
- data/spec/sample_certs/cpanel.key +28 -0
- data/spec/sample_certs/main.crt +27 -0
- data/spec/sample_certs/sample.crt +26 -0
- data/spec/sample_certs/sample.key +27 -0
- data/spec/spec_helper.rb +10 -3
- data/spec/support/cpanel_matchers.rb +17 -0
- data/spec/vcr_cassettes/cpanel/addon_domain/add.yml +77 -0
- data/spec/vcr_cassettes/cpanel/addon_domain/list.yml +77 -0
- data/spec/vcr_cassettes/cpanel/addon_domain/remove.yml +77 -0
- data/spec/vcr_cassettes/cpanel/backups/list.yml +40 -0
- data/spec/vcr_cassettes/cpanel/box_trapper/list.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_icons.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_image_types.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_object_types.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_pkgs.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_sprites.yml +40 -0
- data/spec/vcr_cassettes/cpanel/contact/show.yml +40 -0
- data/spec/vcr_cassettes/cpanel/contact/update.yml +40 -0
- data/spec/vcr_cassettes/cpanel/cron/add.yml +77 -0
- data/spec/vcr_cassettes/cpanel/cron/edit.yml +114 -0
- data/spec/vcr_cassettes/cpanel/cron/email.yml +77 -0
- data/spec/vcr_cassettes/cpanel/cron/list.yml +77 -0
- data/spec/vcr_cassettes/cpanel/cron/remove.yml +151 -0
- data/spec/vcr_cassettes/cpanel/cron/set_email.yml +77 -0
- data/spec/vcr_cassettes/cpanel/dns_lookup/name_to_ip.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_keys/add.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_keys/available.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_keys/installed.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_keys/remove.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/count.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/docroot.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/docroots.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/document_root.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/document_roots.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/list.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/acceptable_encodings.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/accounts.yml +188 -0
- data/spec/vcr_cassettes/cpanel/email/add_account.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/add_filter.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/add_forwarder.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/add_mailing_list.yml +73 -0
- data/spec/vcr_cassettes/cpanel/email/add_mx.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/change_mx.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/change_password.yml +43 -0
- data/spec/vcr_cassettes/cpanel/email/check_local_delivery_local.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/check_local_delivery_remote.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/default_address.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/delete_mx.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/disk_usage.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/domains.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/domains_with_aliases.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/edit_quota.yml +112 -0
- data/spec/vcr_cassettes/cpanel/email/filters.yml +114 -0
- data/spec/vcr_cassettes/cpanel/email/forwarders.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/mail_dir.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/mail_dirs.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/mailing_lists.yml +73 -0
- data/spec/vcr_cassettes/cpanel/email/main_discard.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/mx.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/remove.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/set_default_address.yml +43 -0
- data/spec/vcr_cassettes/cpanel/email/set_mail_delivery_local.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/set_mail_delivery_remote.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/set_mx_type.yml +40 -0
- data/spec/vcr_cassettes/cpanel/file_manager/disk_usage.yml +38 -0
- data/spec/vcr_cassettes/cpanel/file_manager/list.yml +38 -0
- data/spec/vcr_cassettes/cpanel/file_manager/operate.yml +77 -0
- data/spec/vcr_cassettes/cpanel/file_manager/show.yml +40 -0
- data/spec/vcr_cassettes/cpanel/file_manager/stat.yml +38 -0
- data/spec/vcr_cassettes/cpanel/ftp/addftp.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/delftp.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/listftp.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/listftpsessions.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/listftpwithdisk.yml +95 -0
- data/spec/vcr_cassettes/cpanel/ftp/passwd.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/setquota.yml +43 -0
- data/spec/vcr_cassettes/cpanel/gpg/count.yml +40 -0
- data/spec/vcr_cassettes/cpanel/gpg/count_private.yml +40 -0
- data/spec/vcr_cassettes/cpanel/gpg/list.yml +40 -0
- data/spec/vcr_cassettes/cpanel/gpg/list_private.yml +40 -0
- data/spec/vcr_cassettes/cpanel/locale/show.yml +40 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/add_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/add_host.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/add_user.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/add_user_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/check_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/del_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/del_host.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/del_user.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/del_user_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/init_cache.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/number_of_dbs.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/repair_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/update_privs.yml +42 -0
- data/spec/vcr_cassettes/cpanel/net/query_hostname.yml +40 -0
- data/spec/vcr_cassettes/cpanel/net/traceroute.yml +40 -0
- data/spec/vcr_cassettes/cpanel/park/add.yml +77 -0
- data/spec/vcr_cassettes/cpanel/park/list.yml +77 -0
- data/spec/vcr_cassettes/cpanel/park/list_addon_domains.yml +77 -0
- data/spec/vcr_cassettes/cpanel/park/remove.yml +77 -0
- data/spec/vcr_cassettes/cpanel/password/digest_authentication.yml +77 -0
- data/spec/vcr_cassettes/cpanel/password/modify.yml +77 -0
- data/spec/vcr_cassettes/cpanel/password_strength/all_required_strengths.yml +43 -0
- data/spec/vcr_cassettes/cpanel/password_strength/required_strength.yml +43 -0
- data/spec/vcr_cassettes/cpanel/password_strength/strength.yml +83 -0
- data/spec/vcr_cassettes/cpanel/random_data/show.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/fetchcabundle.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/gencrt.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ssl/gencsr.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ssl/genkey.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/installssl.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/listcrts.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/listcsrs.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/listkeys.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/listsslitems.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/remove.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ssl/showcrt.yml +38 -0
- data/spec/vcr_cassettes/cpanel/ssl/showcsr.yml +38 -0
- data/spec/vcr_cassettes/cpanel/ssl/showkey.yml +38 -0
- data/spec/vcr_cassettes/cpanel/ssl/uploadcrt.yml +40 -0
- data/spec/vcr_cassettes/cpanel/sub_domain/add.yml +77 -0
- data/spec/vcr_cassettes/cpanel/sub_domain/list.yml +77 -0
- data/spec/vcr_cassettes/cpanel/sub_domain/remove.yml +77 -0
- data/spec/vcr_cassettes/cpanel/support/contactable.yml +40 -0
- data/spec/vcr_cassettes/whm/account/accountsummary.yml +41 -29
- data/spec/vcr_cassettes/whm/account/changepackage.yml +73 -43
- data/spec/vcr_cassettes/whm/account/createacct.yml +101 -31
- data/spec/vcr_cassettes/whm/account/domainuserdata.yml +43 -29
- data/spec/vcr_cassettes/whm/account/editquota.yml +78 -57
- data/spec/vcr_cassettes/whm/account/limitbw.yml +79 -57
- data/spec/vcr_cassettes/whm/account/listaccts.yml +195 -100
- data/spec/vcr_cassettes/whm/account/listsuspended.yml +41 -29
- data/spec/vcr_cassettes/whm/account/modifyacct.yml +61 -42
- data/spec/vcr_cassettes/whm/account/myprivs.yml +41 -29
- data/spec/vcr_cassettes/whm/account/passwd.yml +44 -29
- data/spec/vcr_cassettes/whm/account/removeacct.yml +134 -57
- data/spec/vcr_cassettes/whm/account/restoreaccount.yml +310 -135
- data/spec/vcr_cassettes/whm/account/setsiteip.yml +166 -127
- data/spec/vcr_cassettes/whm/account/suspend.yml +75 -43
- data/spec/vcr_cassettes/whm/account/unsuspend.yml +46 -29
- data/spec/vcr_cassettes/whm/cert/fetch_ssl_vhosts.yml +44 -0
- data/spec/vcr_cassettes/whm/cert/fetchsslinfo.yml +38 -0
- data/spec/vcr_cassettes/whm/cert/generatessl.yml +94 -0
- data/spec/vcr_cassettes/whm/cert/installssl.yml +38 -0
- data/spec/vcr_cassettes/whm/cert/listcrts.yml +38 -0
- data/spec/vcr_cassettes/whm/dns/adddns.yml +61 -43
- data/spec/vcr_cassettes/whm/dns/addzonerecord.yml +42 -29
- data/spec/vcr_cassettes/whm/dns/dumpzone.yml +44 -29
- data/spec/vcr_cassettes/whm/dns/editzonerecord.yml +61 -43
- data/spec/vcr_cassettes/whm/dns/getzonerecord.yml +60 -43
- data/spec/vcr_cassettes/whm/dns/killdns.yml +42 -29
- data/spec/vcr_cassettes/whm/dns/listmxs.yml +23 -15
- data/spec/vcr_cassettes/whm/dns/listzones.yml +22 -15
- data/spec/vcr_cassettes/whm/dns/lookupnsip.yml +40 -29
- data/spec/vcr_cassettes/whm/dns/removezonerecord.yml +61 -43
- data/spec/vcr_cassettes/whm/dns/resetzone.yml +42 -29
- data/spec/vcr_cassettes/whm/dns/resolvedomainname.yml +40 -29
- data/spec/vcr_cassettes/whm/dns/savemxs.yml +23 -15
- data/spec/vcr_cassettes/whm/reseller/acctcounts.yml +41 -29
- data/spec/vcr_cassettes/whm/reseller/listacls.yml +22 -15
- data/spec/vcr_cassettes/whm/reseller/listresellers.yml +22 -15
- data/spec/vcr_cassettes/whm/reseller/resellerstats.yml +42 -29
- data/spec/vcr_cassettes/whm/reseller/saveacllist.yml +76 -57
- data/spec/vcr_cassettes/whm/reseller/setacls.yml +40 -29
- data/spec/vcr_cassettes/whm/reseller/setresellerips.yml +42 -28
- data/spec/vcr_cassettes/whm/reseller/setresellerlimits.yml +41 -29
- data/spec/vcr_cassettes/whm/reseller/setresellermainip.yml +59 -43
- data/spec/vcr_cassettes/whm/reseller/setresellernameservers.yml +58 -43
- data/spec/vcr_cassettes/whm/reseller/setresellerpackagelimit.yml +61 -43
- data/spec/vcr_cassettes/whm/reseller/setupreseller.yml +41 -29
- data/spec/vcr_cassettes/whm/reseller/suspendreseller.yml +75 -44
- data/spec/vcr_cassettes/whm/reseller/terminatereseller.yml +83 -46
- data/spec/vcr_cassettes/whm/reseller/unsetupreseller.yml +41 -29
- data/spec/vcr_cassettes/whm/reseller/unsuspendreseller.yml +46 -29
- data/spec/vcr_cassettes/whm/server/addip.yml +24 -15
- data/spec/vcr_cassettes/whm/server/applist.yml +22 -15
- data/spec/vcr_cassettes/whm/server/delip.yml +23 -15
- data/spec/vcr_cassettes/whm/server/disk_usage.yml +45 -0
- data/spec/vcr_cassettes/whm/server/edit_hook.yml +44 -0
- data/spec/vcr_cassettes/whm/server/gethostname.yml +22 -15
- data/spec/vcr_cassettes/whm/server/getlanglist.yml +22 -15
- data/spec/vcr_cassettes/whm/server/gettweaksetting.yml +44 -0
- data/spec/vcr_cassettes/whm/server/list_hooks.yml +44 -0
- data/spec/vcr_cassettes/whm/server/listips.yml +22 -15
- data/spec/vcr_cassettes/whm/server/loadavg.yml +26 -19
- data/spec/vcr_cassettes/whm/server/lookup_nameserver_ip.yml +44 -0
- data/spec/vcr_cassettes/whm/server/my_function.yml +59 -43
- data/spec/vcr_cassettes/whm/server/nvget.yml +22 -15
- data/spec/vcr_cassettes/whm/server/nvset.yml +22 -15
- data/spec/vcr_cassettes/whm/server/reboot.yml +22 -15
- data/spec/vcr_cassettes/whm/server/sethostname.yml +24 -15
- data/spec/vcr_cassettes/whm/server/setresolvers.yml +23 -15
- data/spec/vcr_cassettes/whm/server/settweaksetting.yml +44 -0
- data/spec/vcr_cassettes/whm/server/showbw.yml +22 -15
- data/spec/vcr_cassettes/whm/server/systemloadavg.yml +40 -29
- data/spec/vcr_cassettes/whm/server/themes.yml +38 -0
- data/spec/vcr_cassettes/whm/server/version.yml +22 -15
- data/spec/vcr_cassettes/whm/transfer_tool/check.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/create.yml +72 -0
- data/spec/vcr_cassettes/whm/transfer_tool/enqueue.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/pause.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/show_log.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/start.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/status.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/validate_user.yml +44 -0
- data/spec/vcr_cassettes/whostmgr/ssl/create.yml +219 -0
- data/spec/vcr_cassettes/whostmgr/ssl/remove.yml +172 -0
- data/spec/vcr_cassettes/whostmgr/ssl/remove_data.yml +179 -0
- data/spec/whm/account_spec.rb +90 -249
- data/spec/whm/base_spec.rb +3 -7
- data/spec/whm/cert_spec.rb +110 -0
- data/spec/whm/dns_spec.rb +37 -155
- data/spec/whm/reseller_spec.rb +46 -114
- data/spec/whm/server_spec.rb +142 -156
- data/spec/whm/transfer_tool_spec.rb +172 -0
- data/spec/whm/whm_spec.rb +8 -8
- data/spec/whostmgr/ssl_spec.rb +55 -0
- metadata +528 -108
- data/.gitignore +0 -10
- data/.rspec +0 -2
- data/.rvmrc +0 -49
- data/.travis.yml +0 -11
- data/lib/lumberg/whm/args.rb +0 -113
- data/lib/net_http_hacked.rb +0 -42
- data/lumberg.gemspec +0 -28
- data/spec/vcr_cassettes/whm/server/response_type.yml +0 -85
- data/spec/whm/args_spec.rb +0 -179
@@ -0,0 +1,71 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Lumberg
|
4
|
+
describe Cpanel::Ftp do
|
5
|
+
let(:server) { Whm::Server.new(host: @whm_host, hash: @whm_hash) }
|
6
|
+
let(:api_username) { "lumberg" }
|
7
|
+
|
8
|
+
let(:ftp) do
|
9
|
+
described_class.new(
|
10
|
+
server: server,
|
11
|
+
api_username: api_username
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "#list_ftp" do
|
16
|
+
use_vcr_cassette("cpanel/ftp/listftp")
|
17
|
+
|
18
|
+
it "lists ftp accounts associated to the account" do
|
19
|
+
ftp.list_ftp[:params][:data][0][:user].should eq("hello")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "#list_ftp_sessions" do
|
24
|
+
use_vcr_cassette("cpanel/ftp/listftpsessions")
|
25
|
+
|
26
|
+
it "lists ftp sessions associated to the account" do
|
27
|
+
ftp.list_ftp_sessions[:params][:data][0][:status].should eq("IDLE")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "#list_ftp_with_disk" do
|
32
|
+
use_vcr_cassette("cpanel/ftp/listftpwithdisk")
|
33
|
+
|
34
|
+
it "lists ftp accounts with disk information" do
|
35
|
+
ftp.list_ftp_with_disk[:params][:data][0][:_diskused].should eq("0")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe "#add_ftp" do
|
40
|
+
use_vcr_cassette("cpanel/ftp/addftp")
|
41
|
+
|
42
|
+
it "creates the account" do
|
43
|
+
ftp.add_ftp(user: 'bob', pass: 'boo')[:params][:data][0][:reason].should eq("OK")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe "#passwd" do
|
48
|
+
use_vcr_cassette("cpanel/ftp/passwd")
|
49
|
+
|
50
|
+
it "changes the password of the account" do
|
51
|
+
ftp.passwd(user: 'bob', pass: 'boo')[:params][:data][0][:reason].should eq("OK")
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "#setquota" do
|
56
|
+
use_vcr_cassette("cpanel/ftp/setquota")
|
57
|
+
|
58
|
+
it "sets a quota for the account" do
|
59
|
+
ftp.set_quota(user: 'bob', quota: '100')[:params][:data][0][:reason].should eq("OK")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe "#del_ftp" do
|
64
|
+
use_vcr_cassette("cpanel/ftp/delftp")
|
65
|
+
|
66
|
+
it "removes the account" do
|
67
|
+
ftp.del_ftp(user: 'bob', destroy: '1')[:params][:data][0][:reason].should eq("OK")
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Lumberg
|
4
|
+
describe Cpanel::Gpg do
|
5
|
+
let(:server) { Whm::Server.new(host: @whm_host, hash: @whm_hash) }
|
6
|
+
let(:api_username) { "lumberg" }
|
7
|
+
let(:gpg) do
|
8
|
+
described_class.new(
|
9
|
+
server: server,
|
10
|
+
api_username: api_username
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#list" do
|
15
|
+
use_vcr_cassette "cpanel/gpg/list"
|
16
|
+
|
17
|
+
subject { gpg.list[:params][:data] }
|
18
|
+
|
19
|
+
it { should be_an(Array) }
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "#count" do
|
23
|
+
use_vcr_cassette "cpanel/gpg/count"
|
24
|
+
|
25
|
+
subject { gpg.count[:params][:data][0][:count] }
|
26
|
+
|
27
|
+
it { should be_a(Integer) }
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "#list_private" do
|
31
|
+
use_vcr_cassette "cpanel/gpg/list_private"
|
32
|
+
|
33
|
+
subject { gpg.list_private[:params][:data] }
|
34
|
+
|
35
|
+
it { should be_an(Array) }
|
36
|
+
end
|
37
|
+
|
38
|
+
describe "#count_private" do
|
39
|
+
use_vcr_cassette "cpanel/gpg/count_private"
|
40
|
+
|
41
|
+
subject { gpg.count_private[:params][:data][0][:count] }
|
42
|
+
|
43
|
+
it { should be_a(Integer) }
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Lumberg
|
4
|
+
describe Cpanel::Locale do
|
5
|
+
let(:server) { Whm::Server.new(host: @whm_host, hash: @whm_hash) }
|
6
|
+
let(:api_username) { "lumberg" }
|
7
|
+
let(:locale) do
|
8
|
+
described_class.new(
|
9
|
+
server: server,
|
10
|
+
api_username: api_username
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#show" do
|
15
|
+
use_vcr_cassette "cpanel/locale/show"
|
16
|
+
|
17
|
+
subject { locale.show[:params][:data][0][:encoding] }
|
18
|
+
|
19
|
+
it { should be_a(String) }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
File without changes
|
@@ -0,0 +1,119 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Lumberg
|
4
|
+
describe Cpanel::MysqlDb do
|
5
|
+
let(:server) { Whm::Server.new(host: @whm_host, hash: @whm_hash) }
|
6
|
+
let(:api_username) { "lumberg" }
|
7
|
+
let(:mysql_db) do
|
8
|
+
described_class.new(
|
9
|
+
server: server,
|
10
|
+
api_username: api_username
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#add_db" do
|
15
|
+
use_vcr_cassette("cpanel/mysql_db/add_db")
|
16
|
+
|
17
|
+
it "adds a db" do
|
18
|
+
mysql_db.add_db(dbname: 'cpanel')[:params][:result].should_not be_nil
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "#add_user" do
|
23
|
+
use_vcr_cassette("cpanel/mysql_db/add_user")
|
24
|
+
|
25
|
+
it "adds a user" do
|
26
|
+
mysql_db.add_user(username: 'first', password: 'first_pass')[:params][:result].should_not be_nil
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "#add_user_db" do
|
31
|
+
use_vcr_cassette("cpanel/mysql_db/add_user_db")
|
32
|
+
|
33
|
+
it "adds a user to a db" do
|
34
|
+
mysql_db.add_user_db(dbname: 'lumberg_cpanel', dbuser: 'lumberg_first',
|
35
|
+
perms_list: 'all')[:params][:result].should_not be_nil
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe "#number_of_dbs" do
|
40
|
+
use_vcr_cassette("cpanel/mysql_db/number_of_dbs")
|
41
|
+
|
42
|
+
it "gets number of dbs" do
|
43
|
+
mysql_db.number_of_dbs[:params][:result].should eq("1")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe "#check_db" do
|
48
|
+
use_vcr_cassette("cpanel/mysql_db/check_db")
|
49
|
+
|
50
|
+
it "checks db" do
|
51
|
+
mysql_db.check_db(dbname: 'lumberg_cpanel')[:params][:result].should_not be_nil
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "#repair_db" do
|
56
|
+
use_vcr_cassette("cpanel/mysql_db/repair_db")
|
57
|
+
|
58
|
+
it "repairs the db" do
|
59
|
+
mysql_db.repair_db(dbname: 'lumberg_cpanel')[:params][:result].should_not be_nil
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe "#update_privs" do
|
64
|
+
use_vcr_cassette("cpanel/mysql_db/update_privs")
|
65
|
+
|
66
|
+
it "updates privileges" do
|
67
|
+
mysql_db.update_privs[:params][:result].should_not be_nil
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe "#init_cache" do
|
72
|
+
use_vcr_cassette("cpanel/mysql_db/init_cache")
|
73
|
+
|
74
|
+
it "refreshes the cache of MySQL information" do
|
75
|
+
mysql_db.init_cache[:params][:result].should_not be_nil
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
describe "#del_user_db" do
|
80
|
+
use_vcr_cassette("cpanel/mysql_db/del_user_db")
|
81
|
+
|
82
|
+
it "disallows a user from accessing a db" do
|
83
|
+
mysql_db.del_user_db(dbname: 'lumberg_cpanel', dbuser: 'lumberg_first')[:params][:result].should_not be_nil
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
describe "#del_user" do
|
88
|
+
use_vcr_cassette("cpanel/mysql_db/del_user")
|
89
|
+
|
90
|
+
it "deletes a user" do
|
91
|
+
mysql_db.del_user(dbuser: 'lumberg_first')[:params][:result].should_not be_nil
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
describe "#del_db" do
|
96
|
+
use_vcr_cassette("cpanel/mysql_db/del_db")
|
97
|
+
|
98
|
+
it "deletes a db" do
|
99
|
+
mysql_db.del_db(dbname: 'lumberg_cpanel')[:params][:result].should_not be_nil
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
describe "#add_host" do
|
104
|
+
use_vcr_cassette("cpanel/mysql_db/add_host")
|
105
|
+
|
106
|
+
it "adds a host" do
|
107
|
+
mysql_db.add_host(hostname: 'cpanel_test.com')[:params][:result].should_not be_nil
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
describe "#del_host" do
|
112
|
+
use_vcr_cassette("cpanel/mysql_db/del_host")
|
113
|
+
|
114
|
+
it "deletes a host" do
|
115
|
+
mysql_db.del_host(host: 'cpanel_test.com')[:params][:result].should_not be_nil
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
File without changes
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Lumberg
|
4
|
+
describe Cpanel::Net do
|
5
|
+
let(:server) { Whm::Server.new(host: @whm_host, hash: @whm_hash) }
|
6
|
+
let(:api_username) { "lumberg" }
|
7
|
+
let(:net) do
|
8
|
+
described_class.new(
|
9
|
+
server: server,
|
10
|
+
api_username: api_username
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#traceroute" do
|
15
|
+
use_vcr_cassette "cpanel/net/traceroute"
|
16
|
+
|
17
|
+
subject { net.traceroute[:params][:data] }
|
18
|
+
|
19
|
+
it { should be_an(Array) }
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "#query_hostname" do
|
23
|
+
use_vcr_cassette "cpanel/net/query_hostname"
|
24
|
+
|
25
|
+
subject { net.query_hostname({ host: 'google.com' })[:params][:data] }
|
26
|
+
|
27
|
+
it { should be_an(Array) }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Lumberg
|
4
|
+
describe Cpanel::Park do
|
5
|
+
before(:each) do
|
6
|
+
@login = { host: @whm_host, hash: @whm_hash }
|
7
|
+
@server = Whm::Server.new(@login.dup)
|
8
|
+
|
9
|
+
@api_username = "lumberg"
|
10
|
+
@park = Cpanel::Park.new(
|
11
|
+
server: @server.dup,
|
12
|
+
api_username: @api_username
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
describe "#add" do
|
17
|
+
use_vcr_cassette "cpanel/park/add"
|
18
|
+
|
19
|
+
it "creates a new parked domain" do
|
20
|
+
# Remove first
|
21
|
+
@park.remove(domain: "test-park.com")
|
22
|
+
|
23
|
+
result = @park.add(domain: "test-park.com")
|
24
|
+
result[:params][:data].first[:result].should == 1
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "#remove" do
|
29
|
+
use_vcr_cassette "cpanel/park/remove"
|
30
|
+
|
31
|
+
it "removes a parked domain" do
|
32
|
+
# Add first
|
33
|
+
@park.add(domain: "test-park.com")
|
34
|
+
|
35
|
+
result = @park.remove(domain: "test-park.com")
|
36
|
+
result[:params][:data].first[:result].should == 1
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe "#list" do
|
41
|
+
use_vcr_cassette "cpanel/park/list"
|
42
|
+
|
43
|
+
context "parked domains exist on the account" do
|
44
|
+
let(:result) { @park.list }
|
45
|
+
subject { result[:params][:data] }
|
46
|
+
|
47
|
+
it "returns an array with info for each parked domain" do
|
48
|
+
subject.should be_an(Array)
|
49
|
+
subject.each {|info|
|
50
|
+
info.keys.should include(
|
51
|
+
:status, :reldir, :dir, :basedir, :domain
|
52
|
+
)
|
53
|
+
}
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
context "no parked domains exist on the account" do
|
58
|
+
before { @park.api_username = "minimal" }
|
59
|
+
after { @park.api_username = "lumberg" }
|
60
|
+
|
61
|
+
it "returns an empty array" do
|
62
|
+
@park.list[:params][:data].should be_empty
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
describe "#list_addon_domains" do
|
68
|
+
use_vcr_cassette "cpanel/park/list_addon_domains"
|
69
|
+
|
70
|
+
context "addon domains exist on the account" do
|
71
|
+
let(:result) { @park.list_addon_domains }
|
72
|
+
subject { result[:params][:data] }
|
73
|
+
|
74
|
+
it "returns an array with info for each addon domain" do
|
75
|
+
subject.should be_an(Array)
|
76
|
+
subject.each {|info|
|
77
|
+
info.keys.should include(
|
78
|
+
:status, :reldir, :dir, :basedir, :domain
|
79
|
+
)
|
80
|
+
}
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
context "no addon domains exist on the account" do
|
85
|
+
before { @park.api_username = "minimal" }
|
86
|
+
after { @park.api_username = "lumberg" }
|
87
|
+
|
88
|
+
it "returns an empty array" do
|
89
|
+
@park.list_addon_domains[:params][:data].should be_empty
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Lumberg
|
4
|
+
describe Cpanel::Password do
|
5
|
+
let(:server) { Whm::Server.new(host: @whm_host, hash: @whm_hash) }
|
6
|
+
let(:api_username) { "lumberg" }
|
7
|
+
let(:password) do
|
8
|
+
described_class.new(
|
9
|
+
server: server,
|
10
|
+
api_username: api_username
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:random_password) { "realtopsecretpassword" }
|
15
|
+
|
16
|
+
describe "#modify" do
|
17
|
+
use_vcr_cassette "cpanel/password/modify"
|
18
|
+
|
19
|
+
it "sets a new password for account" do
|
20
|
+
result = password.modify({ old: '12345', new: random_password })
|
21
|
+
result[:params][:data][0].should be_a(Hash)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "#digest_authentication" do
|
26
|
+
use_vcr_cassette "cpanel/password/digest_authentication"
|
27
|
+
|
28
|
+
it "enables digest authentication for account" do
|
29
|
+
result = password.digest_authentication({ password: random_password, enable: true })
|
30
|
+
result[:params][:data][0].should be_a(Hash)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Lumberg
|
4
|
+
describe Cpanel::PasswordStrength do
|
5
|
+
let(:server) { Whm::Server.new(host: @whm_host, hash: @whm_hash) }
|
6
|
+
let(:api_username) { "lumberg" }
|
7
|
+
let(:password_strength) do
|
8
|
+
described_class.new(
|
9
|
+
server: server,
|
10
|
+
api_username: api_username
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:weak_password) { "weakness" }
|
15
|
+
let(:strong_password) { "0zUIcv-0" }
|
16
|
+
|
17
|
+
describe "#strength" do
|
18
|
+
use_vcr_cassette "cpanel/password_strength/strength"
|
19
|
+
|
20
|
+
it "tests a weak password" do
|
21
|
+
result = password_strength.strength( password: weak_password )
|
22
|
+
result[:params][:data][0][:strength].to_s.should =~ /\A\d+\z/
|
23
|
+
end
|
24
|
+
|
25
|
+
it "tests a strong password" do
|
26
|
+
result = password_strength.strength( password: strong_password )
|
27
|
+
result[:params][:data][0][:strength].to_s.should =~ /\A\d+\z/
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "#required_strength" do
|
32
|
+
use_vcr_cassette "cpanel/password_strength/required_strength"
|
33
|
+
|
34
|
+
it "gets required password strength for a specific app" do
|
35
|
+
result = password_strength.required_strength( app: 'htaccess' )
|
36
|
+
result[:params][:data][0][:strength].should be_an(Integer)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe "#all_required_strengths" do
|
41
|
+
use_vcr_cassette "cpanel/password_strength/all_required_strengths"
|
42
|
+
|
43
|
+
it "gets required password strengths for all apps" do
|
44
|
+
result = password_strength.all_required_strengths
|
45
|
+
result[:params][:data][0].should be_a(Hash)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Lumberg
|
4
|
+
describe Cpanel::RandomData do
|
5
|
+
let(:server) { Whm::Server.new(host: @whm_host, hash: @whm_hash) }
|
6
|
+
let(:api_username) { "lumberg" }
|
7
|
+
let(:random_data) do
|
8
|
+
described_class.new(
|
9
|
+
server: server,
|
10
|
+
api_username: api_username
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#show" do
|
15
|
+
use_vcr_cassette "cpanel/random_data/show"
|
16
|
+
|
17
|
+
it "gets a random string" do
|
18
|
+
result = random_data.show({ length: 10 })[:params][:data]
|
19
|
+
result[0][:random].size.should === 10
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
File without changes
|
@@ -0,0 +1,158 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
|
4
|
+
module Lumberg
|
5
|
+
describe Cpanel::Ssl do
|
6
|
+
let(:domain) { "lumberg-test.com" }
|
7
|
+
let(:server) { Whm::Server.new(host: @whm_host, hash: @whm_hash) }
|
8
|
+
let(:api_username) { "lumberg" }
|
9
|
+
|
10
|
+
CP_CERT = File.read('./spec/sample_certs/cpanel.crt')
|
11
|
+
CP_KEY = File.read('./spec/sample_certs/cpanel.key')
|
12
|
+
|
13
|
+
let(:cert_params) do
|
14
|
+
{
|
15
|
+
user: :api_username,
|
16
|
+
city: "Chicago",
|
17
|
+
company: "Initech",
|
18
|
+
company_division: "TPS",
|
19
|
+
country: "US",
|
20
|
+
state: "IL",
|
21
|
+
email: "lumberg@initech.com",
|
22
|
+
host: domain,
|
23
|
+
pass: "Tru3St0ry",
|
24
|
+
key: CP_KEY
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
let(:ssl) do
|
29
|
+
described_class.new(
|
30
|
+
server: server,
|
31
|
+
api_username: api_username
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "#installssl" do
|
36
|
+
use_vcr_cassette("cpanel/ssl/installssl")
|
37
|
+
|
38
|
+
it "installs a certificate for a cPanel account" do
|
39
|
+
ssl.installssl(user: :api_username, crt: CP_CERT,
|
40
|
+
domain: domain, key: CP_KEY)[:params][:data][0][:result].should eq(1)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "#listcsrs" do
|
45
|
+
use_vcr_cassette("cpanel/ssl/listcsrs")
|
46
|
+
|
47
|
+
it "prints the csrs for a cPanel account" do
|
48
|
+
ssl.listcsrs(user: :api_username
|
49
|
+
)[:params][:data][0][:host].should == domain
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe "#showcsr" do
|
54
|
+
use_vcr_cassette("cpanel/ssl/showcsr")
|
55
|
+
|
56
|
+
it "prints the current csr for a domain" do
|
57
|
+
ssl.showcsr(user: :api_username, domain: domain, textmode: 0
|
58
|
+
)[:params].to_s.should =~ /CERTIFICATE REQUEST/
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe "#showkey" do
|
63
|
+
use_vcr_cassette("cpanel/ssl/showkey")
|
64
|
+
|
65
|
+
it "prints the current key for a domain" do
|
66
|
+
ssl.showkey(user: :api_username, domain: domain, textmode: 0
|
67
|
+
)[:params].to_s.should =~ /PRIVATE KEY/
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe "#showcrt" do
|
72
|
+
use_vcr_cassette("cpanel/ssl/showcrt")
|
73
|
+
|
74
|
+
it "prints the current cert for a domain" do
|
75
|
+
ssl.showcrt(user: :api_username, domain: domain, textmode: 0
|
76
|
+
)[:params].to_s.should =~ /BEGIN CERTIFICATE/
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
describe "#listcrts" do
|
81
|
+
use_vcr_cassette("cpanel/ssl/listcrts")
|
82
|
+
|
83
|
+
it "lists the certs installed for an account " do
|
84
|
+
ssl.listcrts(user: :api_username)[:params][:data][0][:ssltxt].to_s.should \
|
85
|
+
=~ /Certificate/
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
describe "#listkeys" do
|
90
|
+
use_vcr_cassette("cpanel/ssl/listkeys")
|
91
|
+
|
92
|
+
it "lists the keys installed for an account" do
|
93
|
+
ssl.listkeys(user: :api_username)[:params][:data][0][:host].should == domain
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
describe "#fetchcabundle" do
|
98
|
+
use_vcr_cassette("cpanel/ssl/fetchcabundle")
|
99
|
+
|
100
|
+
it "fetches the CA bundle tied to the cert if any exist" do
|
101
|
+
ssl.listsslitems(crt: CP_CERT)[:params][:event][:result].should eq(1)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
describe "#listsslitems" do
|
106
|
+
use_vcr_cassette("cpanel/ssl/listsslitems")
|
107
|
+
|
108
|
+
it "lists keys for a domain" do
|
109
|
+
ssl.listsslitems(domains: domain, items: 'key')[:params][:data][0][:host].should \
|
110
|
+
== domain
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
describe "#gencsr" do
|
115
|
+
use_vcr_cassette "cpanel/ssl/gencsr"
|
116
|
+
|
117
|
+
it "generates a certificate signing request" do
|
118
|
+
ssl.gencsr(cert_params)[:params][:data][0][:result].should eq(1)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
describe "#gencrt" do
|
123
|
+
use_vcr_cassette "cpanel/ssl/gencrt"
|
124
|
+
|
125
|
+
it "generates a certificate" do
|
126
|
+
ssl.gencrt(cert_params.merge(key: CP_KEY))[:params][:data][0][:result].should eq(1)
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
describe "#genkey" do
|
131
|
+
use_vcr_cassette("cpanel/ssl/genkey")
|
132
|
+
|
133
|
+
it "generates a key" do
|
134
|
+
ssl.genkey(user: api_username, host: domain, keysize: 2048
|
135
|
+
)[:params][:data][0][:result].should eq(1)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
describe "#uploadcrt" do
|
140
|
+
use_vcr_cassette("cpanel/ssl/uploadcrt")
|
141
|
+
|
142
|
+
it "uploads a certificate " do
|
143
|
+
ssl.uploadcrt(user: api_username, crt: CP_CERT,
|
144
|
+
host: domain)[:params][:data][0][:result].should eq(1)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
describe "#remove" do
|
149
|
+
use_vcr_cassette "cpanel/ssl/remove"
|
150
|
+
|
151
|
+
subject { ssl.remove(domain: domain)[:params][:result] }
|
152
|
+
|
153
|
+
it "removes a certificate " do
|
154
|
+
subject.should include "The SSL host was successfully removed."
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|