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
data/spec/whm/reseller_spec.rb
CHANGED
@@ -3,32 +3,28 @@ require 'spec_helper'
|
|
3
3
|
module Lumberg
|
4
4
|
describe Whm::Reseller do
|
5
5
|
before(:each) do
|
6
|
-
@login = { :
|
6
|
+
@login = { host: @whm_host, hash: @whm_hash }
|
7
7
|
@whm = Whm::Server.new(@login.dup)
|
8
|
-
@reseller = Whm::Reseller.new(:
|
8
|
+
@reseller = Whm::Reseller.new(server: @whm)
|
9
9
|
end
|
10
10
|
|
11
11
|
describe "#setup_reseller" do
|
12
12
|
use_vcr_cassette "whm/reseller/setupreseller"
|
13
13
|
|
14
|
-
it "requires username" do
|
15
|
-
requires_attr('username') { @reseller.create }
|
16
|
-
end
|
17
|
-
|
18
14
|
it "fails when the user doesn't exist" do
|
19
|
-
result = @reseller.create(:
|
15
|
+
result = @reseller.create(username: 'invalid')
|
20
16
|
result[:success].should be_false
|
21
17
|
result[:message].should match(/does not exist/i)
|
22
18
|
end
|
23
19
|
|
24
20
|
it "creates a reseller" do
|
25
|
-
result = @reseller.create(:
|
21
|
+
result = @reseller.create(username: 'bob')
|
26
22
|
result[:success].should be_true
|
27
23
|
end
|
28
24
|
|
29
25
|
it "accepts makeowner option" do
|
30
|
-
@reseller.server.should_receive(:perform_request).with('setupreseller', hash_including(:
|
31
|
-
@reseller.create(:
|
26
|
+
@reseller.server.should_receive(:perform_request).with('setupreseller', hash_including(makeowner: true))
|
27
|
+
@reseller.create(username: 'bob', makeowner: true)
|
32
28
|
end
|
33
29
|
end
|
34
30
|
|
@@ -41,22 +37,18 @@ module Lumberg
|
|
41
37
|
result[:params][:resellers].should have(2).resellers
|
42
38
|
result[:params][:resellers].should include('bob', 'ted')
|
43
39
|
end
|
44
|
-
end
|
40
|
+
end
|
45
41
|
|
46
42
|
describe "#setresellerips" do
|
47
43
|
use_vcr_cassette "whm/reseller/setresellerips"
|
48
44
|
|
49
|
-
it "requires a username" do
|
50
|
-
requires_attr('username') { @reseller.add_ips }
|
51
|
-
end
|
52
|
-
|
53
45
|
it "adds the ip address to the reseller account" do
|
54
|
-
result = @reseller.add_ips(:
|
46
|
+
result = @reseller.add_ips(username: 'bob', ips:'192.1.2.3')
|
55
47
|
result[:message].should match(/Successfully configured IP addresses delegation to reseller/i)
|
56
48
|
end
|
57
49
|
|
58
50
|
it "returns an error for invalid ip addresses" do
|
59
|
-
result = @reseller.add_ips(:
|
51
|
+
result = @reseller.add_ips(username: 'bob', ips:'1.2.3.4')
|
60
52
|
result[:message].should match(/The list of supplied IP addresses contains inappropriate values/i)
|
61
53
|
end
|
62
54
|
end
|
@@ -64,13 +56,9 @@ module Lumberg
|
|
64
56
|
describe "#setresellerlimits" do
|
65
57
|
use_vcr_cassette "whm/reseller/setresellerlimits"
|
66
58
|
|
67
|
-
it "requires a username" do
|
68
|
-
requires_attr('username') { @reseller.set_limits }
|
69
|
-
end
|
70
|
-
|
71
59
|
it "sets the limits" do
|
72
|
-
result = @reseller.set_limits(:
|
73
|
-
:
|
60
|
+
result = @reseller.set_limits(username: 'bob', diskspace_limit: 1024, enable_overselling: true,
|
61
|
+
enable_overselling_diskspace: true)
|
74
62
|
result[:success].should be_true
|
75
63
|
result[:message].should match(/Successfully set reseller account .*limits/i)
|
76
64
|
end
|
@@ -79,26 +67,22 @@ module Lumberg
|
|
79
67
|
describe "#terminate" do
|
80
68
|
use_vcr_cassette "whm/reseller/terminatereseller"
|
81
69
|
|
82
|
-
it "requires a reseller" do
|
83
|
-
requires_attr('reseller') { @reseller.terminate }
|
84
|
-
end
|
85
|
-
|
86
70
|
it "terminates the reseller" do
|
87
|
-
result = @reseller.terminate(:
|
71
|
+
result = @reseller.terminate(reseller: 'terminat')
|
88
72
|
result[:success].should be_true
|
89
73
|
result[:message].should match(/account terminations complete/i)
|
90
74
|
result[:params][:accts].should be_empty
|
91
75
|
end
|
92
76
|
|
93
77
|
it "terminates the main account" do
|
94
|
-
result = @reseller.terminate(:
|
78
|
+
result = @reseller.terminate(reseller: 'terminat', terminatereseller: true)
|
95
79
|
result[:success].should be_true
|
96
80
|
result[:message].should match(/account terminations complete/i)
|
97
81
|
result[:params][:accts][:terminat][:rawout].should match(/Account Removal Complete/i)
|
98
82
|
end
|
99
83
|
|
100
84
|
it "errors on non-existaet user" do
|
101
|
-
result = @reseller.terminate(:
|
85
|
+
result = @reseller.terminate(reseller: 'what')
|
102
86
|
result[:success].should be_false
|
103
87
|
result[:message].should match(/does not exist/i)
|
104
88
|
end
|
@@ -108,28 +92,20 @@ module Lumberg
|
|
108
92
|
describe "#setresellermainip" do
|
109
93
|
use_vcr_cassette "whm/reseller/setresellermainip"
|
110
94
|
|
111
|
-
it "requires a username" do
|
112
|
-
requires_attr('username') { @reseller.set_main_ip(:ip => '192.1.2.3') }
|
113
|
-
end
|
114
|
-
|
115
|
-
it "requires an ip" do
|
116
|
-
requires_attr('ip') { @reseller.set_main_ip(:username => 'bob') }
|
117
|
-
end
|
118
|
-
|
119
95
|
it "sets the main ip" do
|
120
|
-
result = @reseller.set_main_ip(:
|
96
|
+
result = @reseller.set_main_ip(username: 'bob', ip: '192.1.2.3')
|
121
97
|
result[:success].should be_true
|
122
98
|
result[:message].should match(/Successfully set main IP address of the reseller/i)
|
123
99
|
end
|
124
100
|
|
125
101
|
it "returns an error when the IP is invalid" do
|
126
|
-
result = @reseller.set_main_ip(:
|
102
|
+
result = @reseller.set_main_ip(username: 'bob', ip: '10')
|
127
103
|
result[:success].should be_false
|
128
104
|
result[:message].should match(/Supplied IP address is invalid/)
|
129
105
|
end
|
130
106
|
|
131
107
|
it "returns an error when the user is invalid" do
|
132
|
-
result = @reseller.set_main_ip(:
|
108
|
+
result = @reseller.set_main_ip(username: 'notexists', ip: '192.1.2.3')
|
133
109
|
result[:success].should be_false
|
134
110
|
result[:message].should match(/Specified user is not a reseller/i)
|
135
111
|
end
|
@@ -138,52 +114,36 @@ module Lumberg
|
|
138
114
|
describe "#setresellerpackagelimit" do
|
139
115
|
use_vcr_cassette "whm/reseller/setresellerpackagelimit"
|
140
116
|
|
141
|
-
it "requires a username" do
|
142
|
-
requires_attr('username') { @reseller.set_package_limit(:no_limit => true, :package => 'gold') }
|
143
|
-
end
|
144
|
-
|
145
|
-
it "requires no_limit" do
|
146
|
-
requires_attr('no_limit') { @reseller.set_package_limit(:username => 'bob', :package => 'gold') }
|
147
|
-
end
|
148
|
-
|
149
|
-
it "requires package" do
|
150
|
-
requires_attr('package') { @reseller.set_package_limit(:username => 'bob', :no_limit => true) }
|
151
|
-
end
|
152
|
-
|
153
117
|
it "sets the package limit" do
|
154
|
-
result = @reseller.set_package_limit(:
|
118
|
+
result = @reseller.set_package_limit(username: 'bob', no_limit: false, package: 'gold', allowed: true)
|
155
119
|
result[:success].should be_true
|
156
120
|
result[:message].should match(/Successfully set reseller package limit/i)
|
157
121
|
end
|
158
122
|
|
159
123
|
it "sets no limit" do
|
160
|
-
result = @reseller.set_package_limit(:
|
124
|
+
result = @reseller.set_package_limit(username: 'bob', no_limit: true, package: 'gold')
|
161
125
|
result[:success].should be_true
|
162
126
|
result[:message].should match(/Successfully set reseller package limit/i)
|
163
127
|
end
|
164
|
-
end
|
128
|
+
end
|
165
129
|
|
166
130
|
describe "#suspendreseller" do
|
167
131
|
use_vcr_cassette "whm/reseller/suspendreseller"
|
168
132
|
|
169
|
-
it "requires a username" do
|
170
|
-
requires_attr('username') { @reseller.suspend }
|
171
|
-
end
|
172
|
-
|
173
133
|
it "suspends the reseller" do
|
174
|
-
result = @reseller.suspend(:
|
134
|
+
result = @reseller.suspend(username: 'bob')
|
175
135
|
result[:success].should be_true
|
176
136
|
result[:message].should match(/Finished suspending reseller/i)
|
177
137
|
end
|
178
138
|
|
179
139
|
it "can take a reason" do
|
180
|
-
result = @reseller.suspend(:
|
140
|
+
result = @reseller.suspend(username: 'bob', reason: 'some reason')
|
181
141
|
result[:success].should be_true
|
182
142
|
result[:message].should match(/Finished suspending reseller/i)
|
183
143
|
end
|
184
144
|
|
185
145
|
it "returns an error when the user is invalid" do
|
186
|
-
result = @reseller.suspend(:
|
146
|
+
result = @reseller.suspend(username: 'notexists')
|
187
147
|
result[:success].should be_false
|
188
148
|
result[:message].should match(/Specified user is not a reseller/i)
|
189
149
|
end
|
@@ -192,18 +152,14 @@ module Lumberg
|
|
192
152
|
describe "#unsuspendreseller" do
|
193
153
|
use_vcr_cassette "whm/reseller/unsuspendreseller"
|
194
154
|
|
195
|
-
it "requires a username" do
|
196
|
-
requires_attr('username') { @reseller.unsuspend }
|
197
|
-
end
|
198
|
-
|
199
155
|
it "should unsuspend the user" do
|
200
|
-
result = @reseller.unsuspend(:
|
156
|
+
result = @reseller.unsuspend(username: 'bob')
|
201
157
|
result[:success].should be_true
|
202
158
|
result[:message].should match(/Finished unsuspending reseller/i)
|
203
159
|
end
|
204
160
|
|
205
161
|
it "return an error when the user is invalid" do
|
206
|
-
result = @reseller.unsuspend(:
|
162
|
+
result = @reseller.unsuspend(username: 'notexists')
|
207
163
|
result[:success].should be_false
|
208
164
|
result[:message].should match(/Specified user is not a reseller/i)
|
209
165
|
end
|
@@ -212,22 +168,18 @@ module Lumberg
|
|
212
168
|
describe "#acctcounts" do
|
213
169
|
use_vcr_cassette "whm/reseller/acctcounts"
|
214
170
|
|
215
|
-
it "requires a username" do
|
216
|
-
requires_attr('username') { @reseller.account_counts }
|
217
|
-
end
|
218
|
-
|
219
171
|
it "returns the account counts" do
|
220
|
-
result = @reseller.account_counts(:
|
172
|
+
result = @reseller.account_counts(username: 'bob')
|
221
173
|
result[:success].should be_true
|
222
174
|
result[:message].should match(/Obtained reseller account counts/i)
|
223
|
-
result[:params][:account].should == "bob"
|
175
|
+
result[:params][:account].should == "bob"
|
224
176
|
result[:params][:suspended].to_i.should == 0
|
225
177
|
result[:params][:active].to_i.should == 0
|
226
|
-
result[:params][:limit].should == ""
|
178
|
+
result[:params][:limit].should == ""
|
227
179
|
end
|
228
180
|
|
229
181
|
it "returns an error when the user is invalid" do
|
230
|
-
result = @reseller.account_counts(:
|
182
|
+
result = @reseller.account_counts(username: 'notexists')
|
231
183
|
result[:success].should be_false
|
232
184
|
result[:message].should match(/Specified user is not a reseller/i)
|
233
185
|
end
|
@@ -236,24 +188,20 @@ module Lumberg
|
|
236
188
|
describe "#setresellernameservers" do
|
237
189
|
use_vcr_cassette "whm/reseller/setresellernameservers"
|
238
190
|
|
239
|
-
it "requires a username" do
|
240
|
-
requires_attr('username') { @reseller.set_nameservers }
|
241
|
-
end
|
242
|
-
|
243
191
|
it "sets the default nameservers" do
|
244
|
-
result = @reseller.set_nameservers(:
|
192
|
+
result = @reseller.set_nameservers(username: 'bob')
|
245
193
|
result[:success].should be_true
|
246
194
|
result[:message].should match(/Set resellers nameservers/i)
|
247
195
|
end
|
248
|
-
|
196
|
+
|
249
197
|
it "sets the specified nameservers" do
|
250
|
-
result = @reseller.set_nameservers(:
|
198
|
+
result = @reseller.set_nameservers(username: 'bob', nameservers: 'ns1.example.com')
|
251
199
|
result[:success].should be_true
|
252
200
|
result[:message].should match(/Set resellers nameservers/i)
|
253
201
|
end
|
254
|
-
|
202
|
+
|
255
203
|
it "returns an error for an invalid username" do
|
256
|
-
result = @reseller.account_counts(:
|
204
|
+
result = @reseller.account_counts(username: 'notexists')
|
257
205
|
result[:success].should be_false
|
258
206
|
result[:message].should match(/Specified user is not a reseller/i)
|
259
207
|
end
|
@@ -262,27 +210,23 @@ module Lumberg
|
|
262
210
|
describe "#resellerstats" do
|
263
211
|
use_vcr_cassette "whm/reseller/resellerstats"
|
264
212
|
|
265
|
-
it "requires a reseller" do
|
266
|
-
requires_attr('reseller') { @reseller.stats }
|
267
|
-
end
|
268
|
-
|
269
213
|
it "returns the stats of the reseller" do
|
270
|
-
result = @reseller.stats(:
|
214
|
+
result = @reseller.stats(reseller: 'bob')
|
271
215
|
result[:success].should be_true
|
272
216
|
result[:message].should match(/Fetched Reseller Data OK/i)
|
273
217
|
result[:params][:diskquota].to_i.should == 0
|
274
|
-
result[:params][:diskoverselling].to_i.should == 1
|
218
|
+
result[:params][:diskoverselling].to_i.should == 1
|
275
219
|
result[:params][:bandwidthlimit].to_i.should == 0
|
276
220
|
end
|
277
221
|
|
278
222
|
it "returns an error for an invalid reseller" do
|
279
|
-
result = @reseller.stats(:
|
223
|
+
result = @reseller.stats(reseller: 'notexists')
|
280
224
|
result[:success].should be_false
|
281
225
|
result[:message].should match(/Reseller Does Not Exist/i)
|
282
226
|
end
|
283
227
|
end
|
284
228
|
|
285
|
-
describe "#
|
229
|
+
describe "#list_acls" do
|
286
230
|
use_vcr_cassette "whm/reseller/listacls"
|
287
231
|
|
288
232
|
it "lists the saved reseller ACL lists" do
|
@@ -297,20 +241,16 @@ module Lumberg
|
|
297
241
|
describe "#saveacllist" do
|
298
242
|
use_vcr_cassette "whm/reseller/saveacllist"
|
299
243
|
|
300
|
-
it "requires an acllist name" do
|
301
|
-
requires_attr('acllist') { @reseller.save_acl_list }
|
302
|
-
end
|
303
|
-
|
304
244
|
it "creates a new reseller ACL list" do
|
305
|
-
result = @reseller.save_acl_list(:
|
245
|
+
result = @reseller.save_acl_list(acllist: 'testacllist')
|
306
246
|
result[:success].should be_true
|
307
247
|
result[:message].should match(/ACL List testacllist saved/i)
|
308
248
|
end
|
309
249
|
|
310
250
|
it "creates a new reseller ACL list with optional settings" do
|
311
|
-
result = @reseller.save_acl_list(:
|
251
|
+
result = @reseller.save_acl_list(acllist: 'testacllist',
|
312
252
|
"acl-ssl".to_sym => true,
|
313
|
-
"acl-add-pkg".to_sym => true,
|
253
|
+
"acl-add-pkg".to_sym => true,
|
314
254
|
"acl-stats".to_sym => true)
|
315
255
|
result[:success].should be_true
|
316
256
|
result[:message].should match(/ACL List testacllist saved/i)
|
@@ -320,18 +260,14 @@ module Lumberg
|
|
320
260
|
describe "#setacls" do
|
321
261
|
use_vcr_cassette "whm/reseller/setacls"
|
322
262
|
|
323
|
-
it "requires a reseller" do
|
324
|
-
requires_attr('reseller') { @reseller.set_acls }
|
325
|
-
end
|
326
|
-
|
327
263
|
it "sets the ACL for the reseller" do
|
328
|
-
result = @reseller.set_acls(:
|
264
|
+
result = @reseller.set_acls(reseller: 'bob', acllist: 'testacllist')
|
329
265
|
result[:success].should be_true
|
330
266
|
result[:message].should match(/Reseller Acls Saved/i)
|
331
267
|
end
|
332
|
-
|
268
|
+
|
333
269
|
it "returns an error for an invalid reseller" do
|
334
|
-
result = @reseller.set_acls(:
|
270
|
+
result = @reseller.set_acls(reseller: 'notexists')
|
335
271
|
result[:success].should be_false
|
336
272
|
result[:message].should match(/Not a reseller/i)
|
337
273
|
end
|
@@ -340,17 +276,13 @@ module Lumberg
|
|
340
276
|
describe "#unsetupreseller" do
|
341
277
|
use_vcr_cassette "whm/reseller/unsetupreseller"
|
342
278
|
|
343
|
-
it "requires a username" do
|
344
|
-
requires_attr('username') { @reseller.unsetup }
|
345
|
-
end
|
346
|
-
|
347
279
|
it "removes the reseller status from the user" do
|
348
|
-
result = @reseller.unsetup(:
|
280
|
+
result = @reseller.unsetup(username: 'bob')
|
349
281
|
result[:success].should be_true
|
350
282
|
end
|
351
283
|
|
352
284
|
it "returns an error if the user does not exist" do
|
353
|
-
result = @reseller.unsetup(:
|
285
|
+
result = @reseller.unsetup(username: 'notexists')
|
354
286
|
result[:success].should be_false
|
355
287
|
result[:message].should match(/called for a user that does not exist/i)
|
356
288
|
end
|