polytrix 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.groc.json +7 -0
  4. data/.rspec +11 -0
  5. data/.rspec_parallel +10 -0
  6. data/Gemfile +23 -0
  7. data/README.md +48 -0
  8. data/Rakefile +143 -0
  9. data/Vagrantfile +41 -0
  10. data/features/0_identity_spec.rb +40 -0
  11. data/features/1_cloud_files_spec.rb +48 -0
  12. data/features/2_servers_spec.rb +19 -0
  13. data/features/features_helper.rb +46 -0
  14. data/features/helpers/cloudfiles_helper.rb +31 -0
  15. data/features/helpers/pacto_helper.rb +33 -0
  16. data/features/helpers/teardown_helper.rb +49 -0
  17. data/features/pacto/extensions/loaders/api_blueprint_loader.rb +63 -0
  18. data/features/pacto/extensions/loaders/simple_loader.rb +55 -0
  19. data/features/pacto/extensions/loaders/yaml_or_json_loader.rb +17 -0
  20. data/features/pacto/extensions/matchers.rb +38 -0
  21. data/features/phase2/feature_coverage_report.rb +109 -0
  22. data/features/phase2/run_all_features.rb +14 -0
  23. data/features/static_site/fixtures/index.html +6 -0
  24. data/lib/polytrix/challenge.rb +27 -0
  25. data/lib/polytrix/challenge_builder.rb +16 -0
  26. data/lib/polytrix/challenge_runner.rb +87 -0
  27. data/lib/polytrix/configuration.rb +31 -0
  28. data/lib/polytrix/core/file_finder.rb +43 -0
  29. data/lib/polytrix/core/implementor.rb +17 -0
  30. data/lib/polytrix/core/result_tracker.rb +25 -0
  31. data/lib/polytrix/documentation_generator.rb +18 -0
  32. data/lib/polytrix/manifest.rb +46 -0
  33. data/lib/polytrix/result.rb +9 -0
  34. data/lib/polytrix/rspec/documentation_formatter.rb +41 -0
  35. data/lib/polytrix/rspec.rb +75 -0
  36. data/lib/polytrix/runners/linux_challenge_runner.rb +22 -0
  37. data/lib/polytrix/runners/middleware/change_directory.rb +20 -0
  38. data/lib/polytrix/runners/middleware/feature_executor.rb +23 -0
  39. data/lib/polytrix/runners/middleware/pacto.rb +59 -0
  40. data/lib/polytrix/runners/middleware/setup_env_vars.rb +38 -0
  41. data/lib/polytrix/runners/windows_challenge_runner.rb +25 -0
  42. data/lib/polytrix/version.rb +3 -0
  43. data/lib/polytrix.rb +56 -0
  44. data/packer/.gitignore +3 -0
  45. data/packer/Berksfile +15 -0
  46. data/packer/Gemfile +5 -0
  47. data/packer/Vagrantfile +128 -0
  48. data/packer/cookbooks/drg/metadata.rb +27 -0
  49. data/packer/cookbooks/drg/recipes/admins.rb +22 -0
  50. data/packer/cookbooks/drg/recipes/default.rb +9 -0
  51. data/packer/cookbooks/drg/recipes/dotnet.rb +4 -0
  52. data/packer/cookbooks/drg/recipes/golang.rb +4 -0
  53. data/packer/cookbooks/drg/recipes/java.rb +5 -0
  54. data/packer/cookbooks/drg/recipes/php.rb +10 -0
  55. data/packer/cookbooks/drg/recipes/ruby.rb +29 -0
  56. data/packer/cookbooks/drg/recipes/system.rb +13 -0
  57. data/packer/create_box.sh +10 -0
  58. data/packer/http/preseed.cfg +87 -0
  59. data/packer/packer.json +91 -0
  60. data/packer/scripts/root_setup.sh +37 -0
  61. data/packer/scripts/setup.sh +32 -0
  62. data/pacto/config/pacto_server.rb +40 -0
  63. data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/extensions.json +64 -0
  64. data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/flavors/id.json +100 -0
  65. data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/images/id.json +176 -0
  66. data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/servers/id.json +189 -0
  67. data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/servers.json +63 -0
  68. data/pacto/contracts/dns.api.rackspacecloud.com/v1.0/_tenant_id/domains.json +62 -0
  69. data/pacto/contracts/identity.api.rackspacecloud.com/v2.0/tokens.json +192 -0
  70. data/pacto/contracts/monitoring.api.rackspacecloud.com/v1.0/_tenant_id/account.json +39 -0
  71. data/pacto/contracts/ord.autoscale.api.rackspacecloud.com/v1.0/_tenant_id/groups.json +38 -0
  72. data/pacto/contracts/ord.blockstorage.api.rackspacecloud.com/v1/_tenant_id/volumes.json +30 -0
  73. data/pacto/contracts/ord.databases.api.rackspacecloud.com/v1.0/_tenant_id/instances.json +30 -0
  74. data/pacto/contracts/ord.loadbalancers.api.rackspacecloud.com/v1.0/_tenant_id/loadbalancers.json +114 -0
  75. data/pacto/contracts/ord.queues.api.rackspacecloud.com/v1/_tenant_id/queues.json +13 -0
  76. data/pacto/contracts/ord.servers.api.rackspacecloud.com/v2/_tenant_id/os-networksv2.json +46 -0
  77. data/pacto/contracts/ord.servers.api.rackspacecloud.com/v2/_tenant_id/servers/detail.json +230 -0
  78. data/pacto/contracts/storage101.dfw1.clouddrive.com/v1/mosso_account/container/object.json +15 -0
  79. data/pacto/contracts/storage101.dfw1.clouddrive.com/v1/mosso_account.json +43 -0
  80. data/pacto/contracts/storage101.ord1.clouddrive.com/v1/_mosso_id.json +44 -0
  81. data/pacto/pacto_server.rb +100 -0
  82. data/pacto/rackspace_uri_map.yaml +229 -0
  83. data/polytrix.gemspec +27 -0
  84. data/scripts/bootstrap +10 -0
  85. data/scripts/cibuild +4 -0
  86. data/sdks/fog/.gitignore +1 -0
  87. data/sdks/fog/Gemfile +5 -0
  88. data/sdks/fog/challenges/all_connections.rb +45 -0
  89. data/sdks/fog/challenges/authenticate_token.rb +15 -0
  90. data/sdks/fog/challenges/cdn_enable_container.rb +20 -0
  91. data/sdks/fog/challenges/create_a_container.rb +17 -0
  92. data/sdks/fog/challenges/create_server.rb +36 -0
  93. data/sdks/fog/challenges/get_object_metadata.rb +13 -0
  94. data/sdks/fog/challenges/list_containers.rb +10 -0
  95. data/sdks/fog/challenges/provision_scalable_webapp.rb +30 -0
  96. data/sdks/fog/challenges/upload_folder.rb +25 -0
  97. data/sdks/fog/scripts/bootstrap +4 -0
  98. data/sdks/fog/scripts/bootstrap.ps1 +1 -0
  99. data/sdks/fog/scripts/wrapper +2 -0
  100. data/sdks/fog/scripts/wrapper.ps1 +1 -0
  101. data/sdks/gophercloud/.gitignore +2 -0
  102. data/sdks/gophercloud/challenges/authenticate_token.go +23 -0
  103. data/sdks/gophercloud/scripts/bootstrap +6 -0
  104. data/sdks/gophercloud/scripts/wrapper +10 -0
  105. data/sdks/jclouds/.gitignore +1 -0
  106. data/sdks/jclouds/challenges/AuthenticateToken.java +115 -0
  107. data/sdks/jclouds/pom.xml +34 -0
  108. data/sdks/jclouds/scripts/bootstrap +3 -0
  109. data/sdks/jclouds/scripts/wrapper +7 -0
  110. data/sdks/openstack.net/.gitignore +4 -0
  111. data/sdks/openstack.net/.nuget/Microsoft.Build.dll +0 -0
  112. data/sdks/openstack.net/.nuget/NuGet.Config +6 -0
  113. data/sdks/openstack.net/.nuget/NuGet.exe +0 -0
  114. data/sdks/openstack.net/.nuget/NuGet.targets +136 -0
  115. data/sdks/openstack.net/Challenge.cs +10 -0
  116. data/sdks/openstack.net/RunChallenge.cs +19 -0
  117. data/sdks/openstack.net/challenges/AuthenticateToken.cs +24 -0
  118. data/sdks/openstack.net/challenges/Weird.cs +133 -0
  119. data/sdks/openstack.net/openstack.net.csproj +58 -0
  120. data/sdks/openstack.net/openstack.net.sln +27 -0
  121. data/sdks/openstack.net/openstack.net.userprefs +8 -0
  122. data/sdks/openstack.net/packages.config +6 -0
  123. data/sdks/openstack.net/scripts/bootstrap +2 -0
  124. data/sdks/openstack.net/scripts/bootstrap.ps1 +2 -0
  125. data/sdks/openstack.net/scripts/wrapper +7 -0
  126. data/sdks/openstack.net/scripts/wrapper.ps1 +1 -0
  127. data/sdks/php-opencloud/.gitignore +4 -0
  128. data/sdks/php-opencloud/challenges/all_connections.php +64 -0
  129. data/sdks/php-opencloud/challenges/authenticate_token.php +14 -0
  130. data/sdks/php-opencloud/challenges/create_server.php +39 -0
  131. data/sdks/php-opencloud/challenges/get_object_metadata.php +19 -0
  132. data/sdks/php-opencloud/composer.json +5 -0
  133. data/sdks/php-opencloud/scripts/bootstrap +4 -0
  134. data/sdks/php-opencloud/scripts/bootstrap.ps1 +2 -0
  135. data/sdks/php-opencloud/scripts/wrapper +2 -0
  136. data/sdks/php-opencloud/scripts/wrapper.ps1 +1 -0
  137. data/sdks/pkgcloud/.gitignore +1 -0
  138. data/sdks/pkgcloud/challenges/authenticate_token.js +17 -0
  139. data/sdks/pkgcloud/challenges/get_object_metadata.js +18 -0
  140. data/sdks/pkgcloud/scripts/bootstrap +2 -0
  141. data/sdks/pkgcloud/scripts/bootstrap.ps1 +1 -0
  142. data/sdks/pkgcloud/scripts/wrapper +2 -0
  143. data/sdks/pkgcloud/scripts/wrapper.ps1 +1 -0
  144. data/sdks/pyrax/.gitignore +2 -0
  145. data/sdks/pyrax/challenges/all_connections.py +61 -0
  146. data/sdks/pyrax/challenges/authenticate_token.py +17 -0
  147. data/sdks/pyrax/challenges/cdn_enable_container.py +22 -0
  148. data/sdks/pyrax/challenges/create_a_container.py +21 -0
  149. data/sdks/pyrax/challenges/create_server.py +35 -0
  150. data/sdks/pyrax/challenges/get_object_metadata.py +17 -0
  151. data/sdks/pyrax/challenges/upload_folder.py +32 -0
  152. data/sdks/pyrax/requirements.txt +21 -0
  153. data/sdks/pyrax/scripts/bootstrap +9 -0
  154. data/sdks/pyrax/scripts/bootstrap.ps1 +7 -0
  155. data/sdks/pyrax/scripts/wrapper +3 -0
  156. data/sdks/pyrax/scripts/wrapper.ps1 +2 -0
  157. data/spec/fixtures/factorial.py +18 -0
  158. data/spec/fixtures/polytrix.yml +16 -0
  159. data/spec/fixtures/src-doc/quine.md.erb +20 -0
  160. data/spec/polytrix/challenge_builder_spec.rb +16 -0
  161. data/spec/polytrix/challenge_runner_spec.rb +14 -0
  162. data/spec/polytrix/challenge_spec.rb +20 -0
  163. data/spec/polytrix/configuration_spec.rb +10 -0
  164. data/spec/polytrix/documentation_generator_spec.rb +36 -0
  165. data/spec/polytrix/file_finder_spec.rb +24 -0
  166. data/spec/polytrix/manifest_spec.rb +26 -0
  167. data/spec/polytrix/middleware/feature_executor_spec.rb +48 -0
  168. data/spec/polytrix_spec.rb +13 -0
  169. data/spec/rspec_spec.rb +17 -0
  170. data/spec/spec_helper.rb +7 -0
  171. metadata +325 -0
@@ -0,0 +1,87 @@
1
+ ## Options to set on the command line
2
+ d-i debian-installer/locale string en_US.utf8
3
+ d-i console-setup/ask_detect boolean false
4
+ d-i console-setup/layout string USA
5
+
6
+ #d-i netcfg/get_hostname string dummy
7
+ d-i netcfg/get_hostname string unassigned-hostname
8
+ d-i netcfg/get_domain string unassigned-domain
9
+
10
+ # Continue without a default route
11
+ # Not working , specify a dummy in the DHCP
12
+ #d-i netcfg/no_default_route boolean
13
+
14
+ d-i time/zone string UTC
15
+ d-i clock-setup/utc-auto boolean true
16
+ d-i clock-setup/utc boolean true
17
+
18
+ d-i kbd-chooser/method select American English
19
+
20
+ d-i netcfg/wireless_wep string
21
+
22
+ d-i base-installer/kernel/override-image string linux-server
23
+ #d-i base-installer/kernel/override-image string linux-image-2.6.32-21-generic
24
+
25
+ # Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
26
+ d-i debconf debconf/frontend select Noninteractive
27
+
28
+ d-i pkgsel/install-language-support boolean false
29
+ tasksel tasksel/first multiselect standard, ubuntu-server
30
+
31
+ #d-i partman-auto/method string regular
32
+ d-i partman-auto/method string lvm
33
+ #d-i partman-auto/purge_lvm_from_device boolean true
34
+
35
+ d-i partman-lvm/confirm boolean true
36
+ d-i partman-lvm/device_remove_lvm boolean true
37
+ d-i partman-auto/choose_recipe select atomic
38
+
39
+ d-i partman/confirm_write_new_label boolean true
40
+ d-i partman/confirm_nooverwrite boolean true
41
+ d-i partman/choose_partition select finish
42
+ d-i partman/confirm boolean true
43
+
44
+ #http://ubuntu-virginia.ubuntuforums.org/showthread.php?p=9626883
45
+ #Message: "write the changes to disk and configure lvm preseed"
46
+ #http://serverfault.com/questions/189328/ubuntu-kickstart-installation-using-lvm-waits-for-input
47
+ #preseed partman-lvm/confirm_nooverwrite boolean true
48
+
49
+ # Write the changes to disks and configure LVM?
50
+ d-i partman-lvm/confirm boolean true
51
+ d-i partman-lvm/confirm_nooverwrite boolean true
52
+ d-i partman-auto-lvm/guided_size string max
53
+
54
+ ## Default user, we can get away with a recipe to change this
55
+ d-i passwd/user-fullname string vagrant
56
+ d-i passwd/username string vagrant
57
+ d-i passwd/user-password password vagrant
58
+ d-i passwd/user-password-again password vagrant
59
+ d-i user-setup/encrypt-home boolean false
60
+ d-i user-setup/allow-password-weak boolean true
61
+
62
+ ## minimum is puppet and ssh and ntp
63
+ # Individual additional packages to install
64
+ d-i pkgsel/include string openssh-server ntp
65
+
66
+ # Whether to upgrade packages after debootstrap.
67
+ # Allowed values: none, safe-upgrade, full-upgrade
68
+ d-i pkgsel/upgrade select full-upgrade
69
+
70
+ d-i grub-installer/only_debian boolean true
71
+ d-i grub-installer/with_other_os boolean true
72
+ d-i finish-install/reboot_in_progress note
73
+
74
+ #For the update
75
+ d-i pkgsel/update-policy select none
76
+
77
+ # debconf-get-selections --install
78
+ #Use mirror
79
+ #d-i apt-setup/use_mirror boolean true
80
+ #d-i mirror/country string manual
81
+ #choose-mirror-bin mirror/protocol string http
82
+ #choose-mirror-bin mirror/http/hostname string 192.168.4.150
83
+ #choose-mirror-bin mirror/http/directory string /ubuntu
84
+ #choose-mirror-bin mirror/suite select maverick
85
+ #d-i debian-installer/allow_unauthenticated string true
86
+
87
+ choose-mirror-bin mirror/http/proxy string
@@ -0,0 +1,91 @@
1
+ {
2
+ "variables": {
3
+ "RAX_USERNAME": null,
4
+ "RAX_PASSWORD": null
5
+ },
6
+ "builders": [
7
+ {
8
+ "type": "openstack",
9
+ "username": "{{user `RAX_USERNAME`}}",
10
+ "password": "{{user `RAX_PASSWORD`}}",
11
+ "provider": "rackspace-us",
12
+ "region": "ORD",
13
+ "ssh_username": "root",
14
+ "image_name": "DRG",
15
+ "source_image": "80fbcb55-b206-41f9-9bc2-2dd7aac6c061",
16
+ "flavor": "performance1-2"
17
+ },
18
+ {
19
+ "type": "virtualbox",
20
+ "boot_command": [
21
+ "<esc><esc><enter><wait>",
22
+ "/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
23
+ "debian-installer=en_US auto locale=en_US kbd-chooser/method=us <wait>",
24
+ "hostname={{ .Name }} <wait>",
25
+ "fb=false debconf/frontend=noninteractive <wait>",
26
+ "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false <wait>",
27
+ "initrd=/install/initrd.gz -- <enter><wait>"
28
+ ],
29
+ "boot_wait": "4s",
30
+ "guest_os_type": "Ubuntu_64",
31
+ "http_directory": "http",
32
+ "iso_checksum": "4d1a8b720cdd14b76ed9410c63a00d0e",
33
+ "iso_checksum_type": "md5",
34
+ "iso_url": "http://releases.ubuntu.com/13.10/ubuntu-13.10-server-amd64.iso",
35
+ "ssh_username": "vagrant",
36
+ "ssh_password": "vagrant",
37
+ "ssh_port": 22,
38
+ "ssh_wait_timeout": "10000s",
39
+ "shutdown_command": "echo 'shutdown -P now' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'",
40
+ "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
41
+ "headless": false,
42
+ "virtualbox_version_file": ".vbox_version",
43
+ "vboxmanage": [
44
+ [
45
+ "modifyvm",
46
+ "{{.Name}}",
47
+ "--memory",
48
+ "2048"
49
+ ],
50
+ [
51
+ "modifyvm",
52
+ "{{.Name}}",
53
+ "--cpus",
54
+ "4"
55
+ ]
56
+ ]
57
+ }
58
+ ],
59
+ "provisioners": [
60
+ {
61
+ "type": "shell",
62
+ "only": ["virtualbox"],
63
+ "scripts": [
64
+ "scripts/root_setup.sh"
65
+ ],
66
+ "override": {
67
+ "virtualbox": {
68
+ "execute_command": "echo 'vagrant' | sudo -S sh '{{ .Path }}'"
69
+ }
70
+ }
71
+ },
72
+ {
73
+ "type": "shell",
74
+ "only": ["virtualbox"],
75
+ "scripts": [
76
+ "scripts/setup.sh"
77
+ ]
78
+ },
79
+ {
80
+ "type": "chef-solo",
81
+ "cookbook_paths": ["cookbooks", "vendor/cookbooks"],
82
+ "run_list": ["drg"]
83
+ }
84
+ ],
85
+ "post-processors": [
86
+ {
87
+ "type": "vagrant",
88
+ "only": ["virtualbox"]
89
+ }
90
+ ]
91
+ }
@@ -0,0 +1,37 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ # Updating and Upgrading dependencies
6
+ sudo apt-get update -y -qq > /dev/null
7
+ sudo apt-get upgrade -y -qq > /dev/null
8
+
9
+ # Install necessary libraries for guest additions and Vagrant NFS Share
10
+ sudo apt-get -y -q install linux-headers-$(uname -r) build-essential dkms nfs-common
11
+
12
+ # Install necessary dependencies
13
+ sudo apt-get -y -q install curl wget git tmux firefox xvfb vim
14
+
15
+ # Setup sudo to allow no-password sudo for "admin"
16
+ groupadd -r admin
17
+ usermod -a -G admin vagrant
18
+ cp /etc/sudoers /etc/sudoers.orig
19
+ sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
20
+ sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
21
+
22
+ #Install Redis
23
+ sudo apt-get -y -q install libjemalloc1
24
+ wget -q http://d7jrzzvab3wte.cloudfront.net/checkbot/deb/redis-server_2.6.13-1_amd64.deb
25
+ sha1sum redis-server_2.6.13-1_amd64.deb | grep 'ab50cf037fd63e160946f8946b6d318cdf11800d'
26
+ dpkg -i redis-server_2.6.13-1_amd64.deb
27
+ rm redis-server_2.6.13-1_amd64.deb
28
+
29
+ # Install required libraries for RVM and Ruby
30
+ sudo apt-get -y -q install gawk libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev libxml2-dev libxslt-dev libxml2
31
+
32
+
33
+ # Install Postgresql
34
+ sudo apt-get -y -q install postgresql libpq-dev postgresql-contrib
35
+
36
+ # Set Password to test for user postgres
37
+ sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'test';"
@@ -0,0 +1,32 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ echo "Instaling for rof"
6
+
7
+ # Installing vagrant keys
8
+ mkdir ~/.ssh
9
+ chmod 700 ~/.ssh
10
+ cd ~/.ssh
11
+ wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
12
+ chmod 600 ~/.ssh/authorized_keys
13
+ chown -R vagrant ~/.ssh
14
+
15
+ # Node.js Setup
16
+ # wget --retry-connrefused -q -O - https://raw.github.com/creationix/nvm/master/install.sh | sh
17
+ # source ~/.nvm/nvm.sh
18
+
19
+ # nvm install 0.10.18
20
+ # nvm alias default 0.10.18
21
+
22
+ # echo "source ~/.nvm/nvm.sh" >> ~/.bash_profile
23
+
24
+ # RVM Install
25
+ # wget --retry-connrefused -q -O - https://get.rvm.io | bash -s stable
26
+ # source /home/vagrant/.rvm/scripts/rvm
27
+
28
+ # rvm autolibs read-fail
29
+
30
+ # rvm install 2.0.0-p247
31
+
32
+ # gem install bundler zeus
@@ -0,0 +1,40 @@
1
+ require 'pacto'
2
+
3
+ def token_map
4
+ if File.readable? '.tokens.json'
5
+ MultiJson.load(File.read '.tokens.json')
6
+ else
7
+ {}
8
+ end
9
+ end
10
+
11
+ config[:port] = port
12
+ contracts_path = options[:directory] || File.expand_path('contracts', Dir.pwd)
13
+ Pacto.configure do |pacto_config|
14
+ pacto_config.logger = logger
15
+ pacto_config.contracts_path = contracts_path
16
+ pacto_config.strict_matchers = options[:strict]
17
+ pacto_config.generator_options = {
18
+ :schema_version => :draft3,
19
+ :token_map => token_map
20
+ }
21
+ end
22
+
23
+ if options[:generate]
24
+ Pacto.generate!
25
+ logger.info 'Pacto generation mode enabled'
26
+ end
27
+
28
+ if options[:validate]
29
+ Pacto.validate! if options[:validate]
30
+ # Dir["#{contracts_path}/*"].each do |host_dir|
31
+ # host = File.basename host_dir
32
+ # Pacto.load_contracts(host_dir, "https://#{host}")
33
+ # end
34
+ contracts = Pacto::Extensions::Loaders::URIMapLoader.load(File.absolute_path('pacto/rackspace_uri_map.yaml'))
35
+ end
36
+
37
+ if options[:live]
38
+ # WebMock.reset!
39
+ WebMock.allow_net_connect!
40
+ end
@@ -0,0 +1,64 @@
1
+ {
2
+ "request": {
3
+ "headers": {
4
+ },
5
+ "method": "get",
6
+ "params": {
7
+ },
8
+ "path": "/v2/:account_id/extensions"
9
+ },
10
+ "response": {
11
+ "headers": {
12
+ "Content-Type": "application/json"
13
+ },
14
+ "status": 200,
15
+ "body": {
16
+ "$schema": "http://json-schema.org/draft-03/schema#",
17
+ "description": "Generated from vcr with shasum d0fe7c3680149b7ad092f0d8d22dcbf9b183acad",
18
+ "type": "object",
19
+ "required": true,
20
+ "properties": {
21
+ "extensions": {
22
+ "type": "array",
23
+ "required": true,
24
+ "minItems": 1,
25
+ "uniqueItems": true,
26
+ "items": {
27
+ "type": "object",
28
+ "required": true,
29
+ "properties": {
30
+ "updated": {
31
+ "type": "string",
32
+ "required": true
33
+ },
34
+ "name": {
35
+ "type": "string",
36
+ "required": true
37
+ },
38
+ "links": {
39
+ "type": "array",
40
+ "required": true,
41
+ "minItems": 0,
42
+ "uniqueItems": true,
43
+ "items": {
44
+ }
45
+ },
46
+ "namespace": {
47
+ "type": "string",
48
+ "required": true
49
+ },
50
+ "alias": {
51
+ "type": "string",
52
+ "required": true
53
+ },
54
+ "description": {
55
+ "type": "string",
56
+ "required": true
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
@@ -0,0 +1,100 @@
1
+ {
2
+ "request": {
3
+ "headers": {
4
+ },
5
+ "method": "get",
6
+ "params": {
7
+ },
8
+ "path": "/v2/:account_id/flavors/:id"
9
+ },
10
+ "response": {
11
+ "headers": {
12
+ "Content-Type": "application/json"
13
+ },
14
+ "status": 200,
15
+ "body": {
16
+ "$schema": "http://json-schema.org/draft-03/schema#",
17
+ "description": "Generated from vcr with shasum 3e008d391a01f365204e41d8101e4d204447bdf3",
18
+ "type": "object",
19
+ "required": true,
20
+ "properties": {
21
+ "flavor": {
22
+ "type": "object",
23
+ "required": true,
24
+ "properties": {
25
+ "OS-FLV-WITH-EXT-SPECS:extra_specs": {
26
+ "type": "object",
27
+ "required": true,
28
+ "properties": {
29
+ "class": {
30
+ "type": "string",
31
+ "required": false
32
+ },
33
+ "disk_io_index": {
34
+ "type": "string",
35
+ "required": false
36
+ },
37
+ "number_of_data_disks": {
38
+ "type": "string",
39
+ "required": false
40
+ }
41
+ }
42
+ },
43
+ "name": {
44
+ "type": "string",
45
+ "required": true
46
+ },
47
+ "links": {
48
+ "type": "array",
49
+ "required": true,
50
+ "minItems": 1,
51
+ "uniqueItems": true,
52
+ "items": {
53
+ "type": "object",
54
+ "required": true,
55
+ "properties": {
56
+ "href": {
57
+ "type": "string",
58
+ "required": true
59
+ },
60
+ "rel": {
61
+ "type": "string",
62
+ "required": true
63
+ }
64
+ }
65
+ }
66
+ },
67
+ "ram": {
68
+ "type": "integer",
69
+ "required": true
70
+ },
71
+ "vcpus": {
72
+ "type": "integer",
73
+ "required": true
74
+ },
75
+ "swap": {
76
+ "type": "integer",
77
+ "required": true
78
+ },
79
+ "rxtx_factor": {
80
+ "type": "number",
81
+ "required": true
82
+ },
83
+ "OS-FLV-EXT-DATA:ephemeral": {
84
+ "type": "integer",
85
+ "required": true
86
+ },
87
+ "disk": {
88
+ "type": "integer",
89
+ "required": true
90
+ },
91
+ "id": {
92
+ "type": "string",
93
+ "required": true
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,176 @@
1
+ {
2
+ "request": {
3
+ "headers": {
4
+ },
5
+ "method": "get",
6
+ "params": {
7
+ },
8
+ "path": "/v2/:account_id/images/:id"
9
+ },
10
+ "response": {
11
+ "headers": {
12
+ "Content-Type": "application/json"
13
+ },
14
+ "status": 200,
15
+ "body": {
16
+ "$schema": "http://json-schema.org/draft-03/schema#",
17
+ "description": "Generated from vcr with shasum 84e4f99e789ea3412d751782552d036dad968eee",
18
+ "type": "object",
19
+ "required": true,
20
+ "properties": {
21
+ "image": {
22
+ "type": "object",
23
+ "required": true,
24
+ "properties": {
25
+ "status": {
26
+ "type": "string",
27
+ "required": true
28
+ },
29
+ "updated": {
30
+ "type": "string",
31
+ "required": true
32
+ },
33
+ "links": {
34
+ "type": "array",
35
+ "required": true,
36
+ "minItems": 1,
37
+ "uniqueItems": true,
38
+ "items": {
39
+ "type": "object",
40
+ "required": true,
41
+ "properties": {
42
+ "href": {
43
+ "type": "string",
44
+ "required": true
45
+ },
46
+ "rel": {
47
+ "type": "string",
48
+ "required": true
49
+ }
50
+ }
51
+ }
52
+ },
53
+ "OS-DCF:diskConfig": {
54
+ "type": "string",
55
+ "required": true
56
+ },
57
+ "id": {
58
+ "type": "string",
59
+ "required": true
60
+ },
61
+ "OS-EXT-IMG-SIZE:size": {
62
+ "type": "integer",
63
+ "required": true
64
+ },
65
+ "name": {
66
+ "type": "string",
67
+ "required": true
68
+ },
69
+ "created": {
70
+ "type": "string",
71
+ "required": true
72
+ },
73
+ "minDisk": {
74
+ "type": "integer",
75
+ "required": true
76
+ },
77
+ "progress": {
78
+ "type": "integer",
79
+ "required": true
80
+ },
81
+ "minRam": {
82
+ "type": "integer",
83
+ "required": true
84
+ },
85
+ "metadata": {
86
+ "type": "object",
87
+ "required": true,
88
+ "properties": {
89
+ "os_distro": {
90
+ "type": "string",
91
+ "required": true
92
+ },
93
+ "com.rackspace__1__visible_core": {
94
+ "type": "string",
95
+ "required": true
96
+ },
97
+ "com.rackspace__1__build_rackconnect": {
98
+ "type": "string",
99
+ "required": true
100
+ },
101
+ "com.rackspace__1__options": {
102
+ "type": "string",
103
+ "required": true
104
+ },
105
+ "image_type": {
106
+ "type": "string",
107
+ "required": true
108
+ },
109
+ "cache_in_nova": {
110
+ "type": "string",
111
+ "required": true
112
+ },
113
+ "com.rackspace__1__source": {
114
+ "type": "string",
115
+ "required": true
116
+ },
117
+ "org.openstack__1__os_distro": {
118
+ "type": "string",
119
+ "required": true
120
+ },
121
+ "com.rackspace__1__release_build_date": {
122
+ "type": "string",
123
+ "required": true
124
+ },
125
+ "os_type": {
126
+ "type": "string",
127
+ "required": true
128
+ },
129
+ "auto_disk_config": {
130
+ "type": "string",
131
+ "required": true
132
+ },
133
+ "com.rackspace__1__release_version": {
134
+ "type": "string",
135
+ "required": true
136
+ },
137
+ "com.rackspace__1__platform_target": {
138
+ "type": "string",
139
+ "required": true
140
+ },
141
+ "com.rackspace__1__visible_rackconnect": {
142
+ "type": "string",
143
+ "required": true
144
+ },
145
+ "com.rackspace__1__release_id": {
146
+ "type": "string",
147
+ "required": true
148
+ },
149
+ "com.rackspace__1__visible_managed": {
150
+ "type": "string",
151
+ "required": true
152
+ },
153
+ "com.rackspace__1__build_core": {
154
+ "type": "string",
155
+ "required": true
156
+ },
157
+ "org.openstack__1__os_version": {
158
+ "type": "string",
159
+ "required": true
160
+ },
161
+ "org.openstack__1__architecture": {
162
+ "type": "string",
163
+ "required": true
164
+ },
165
+ "com.rackspace__1__build_managed": {
166
+ "type": "string",
167
+ "required": true
168
+ }
169
+ }
170
+ }
171
+ }
172
+ }
173
+ }
174
+ }
175
+ }
176
+ }