test/test_helper.rb in chef-vpc-toolkit-2.0.1 vs test/test_helper.rb in chef-vpc-toolkit-2.1.0
- old
+ new
@@ -10,16 +10,165 @@
require 'tempfile'
require 'fileutils'
class TmpDir
- def self.new_tmp_dir(prefix="chef-cloud-toolkit")
+ def self.new_tmp_dir(prefix="chef-vpc-toolkit")
tmp_file=Tempfile.new prefix
path=tmp_file.path
tmp_file.close(true)
FileUtils.mkdir_p path
return path
end
end
+
+SERVER_GROUP_XML = %{
+<?xml version="1.0" encoding="UTF-8"?>
+<server-group>
+ <created-at type="datetime">2010-10-15T15:15:58-04:00</created-at>
+ <description>test description</description>
+ <domain-name>mydomain.net</domain-name>
+ <historical type="boolean">false</historical>
+ <id type="integer">1759</id>
+ <last-used-ip-address>172.19.0.2</last-used-ip-address>
+ <name>test</name>
+ <owner-name>dan.prince</owner-name>
+ <updated-at type="datetime">2010-10-15T15:15:58-04:00</updated-at>
+ <user-id type="integer">3</user-id>
+ <vpn-network>172.19.0.0</vpn-network>
+ <vpn-subnet>255.255.128.0</vpn-subnet>
+ <servers type="array">
+ <server>
+ <account-id type="integer">3</account-id>
+ <cloud-server-id-number type="integer">1</cloud-server-id-number>
+ <created-at type="datetime">2010-10-15T15:15:58-04:00</created-at>
+ <description>login1</description>
+ <error-message nil="true"></error-message>
+ <external-ip-addr>184.106.205.120</external-ip-addr>
+ <flavor-id type="integer">4</flavor-id>
+ <historical type="boolean">false</historical>
+ <id type="integer">5513</id>
+ <image-id type="integer">14</image-id>
+ <internal-ip-addr>10.179.107.203</internal-ip-addr>
+ <name>login1</name>
+ <openvpn-server type="boolean">true</openvpn-server>
+ <retry-count type="integer">0</retry-count>
+ <server-group-id type="integer">1759</server-group-id>
+ <status>Online</status>
+ <updated-at type="datetime">2010-10-15T15:18:22-04:00</updated-at>
+ <vpn-network-interfaces type="array"/>
+ </server>
+ <server>
+ <account-id type="integer">3</account-id>
+ <cloud-server-id-number type="integer">2</cloud-server-id-number>
+ <created-at type="datetime">2010-10-15T15:15:58-04:00</created-at>
+ <description>test1</description>
+ <error-message nil="true"></error-message>
+ <external-ip-addr>184.106.205.121</external-ip-addr>
+ <flavor-id type="integer">49</flavor-id>
+ <historical type="boolean">false</historical>
+ <id type="integer">5513</id>
+ <image-id type="integer">49</image-id>
+ <internal-ip-addr>10.179.107.204</internal-ip-addr>
+ <name>test1</name>
+ <openvpn-server type="boolean">false</openvpn-server>
+ <retry-count type="integer">0</retry-count>
+ <server-group-id type="integer">1759</server-group-id>
+ <status>Online</status>
+ <updated-at type="datetime">2010-10-15T15:18:22-04:00</updated-at>
+ <vpn-network-interfaces type="array"/>
+ </server>
+ </servers>
+</server-group>
+}
+
+CLIENT_XML = %{
+<client>
+ <created-at type="datetime">2011-01-09T19:37:32-05:00</created-at>
+ <description>Toolkit Client: local</description>
+ <id type="integer">5</id>
+ <is-windows type="boolean">false</is-windows>
+ <name>local</name>
+ <server-group-id type="integer">11</server-group-id>
+ <status>Online</status>
+ <updated-at type="datetime">2011-01-09T19:37:37-05:00</updated-at>
+ <vpn-network-interfaces type="array">
+ <vpn-network-interface>
+ <ca-cert>-----BEGIN CERTIFICATE-----
+MIIDyDCCAzGgAwIBAgIJAORNZNRpPx87MA0GCSqGSIb3DQEBBQUAMIGfMQswCQYD
+VQQGEwJVUzELMAkGA1UECBMCVkExEzARBgNVBAcTCkJsYWNrc2J1cmcxEjAQBgNV
+BAoTCVJhY2tzcGFjZTEXMBUGA1UECxMOSW5mcmFzdHJ1Y3R1cmUxDjAMBgNVBAMT
+BWxvZ2luMQ4wDAYDVQQpEwVsb2dpbjEhMB8GCSqGSIb3DQEJARYSY29icmFAc25h
+a2VvaWwuY29tMB4XDTExMDExMDAwMzI1NVoXDTIxMDEwNzAwMzI1NVowgZ8xCzAJ
+BgNVBAYTAlVTMQswCQYDVQQIEwJWQTETMBEGA1UEBxMKQmxhY2tzYnVyZzESMBAG
+A1UEChMJUmFja3NwYWNlMRcwFQYDVQQLEw5JbmZyYXN0cnVjdHVyZTEOMAwG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iYX+gvycrIph1yyIGA1qeHYnjhQp4ZijhcwSFUAAyF
+-----END RSA PRIVATE KEY-----
+</client-key>
+ <created-at type="datetime">2011-01-09T19:37:32-05:00</created-at>
+ <id type="integer">15</id>
+ <interfacable-id type="integer">5</interfacable-id>
+ <interfacable-type>Client</interfacable-type>
+ <ptp-ip-addr>172.19.0.6</ptp-ip-addr>
+ <updated-at type="datetime">2011-01-09T19:37:36-05:00</updated-at>
+ <vpn-ip-addr>172.19.0.5</vpn-ip-addr>
+ </vpn-network-interface>
+ </vpn-network-interfaces>
+</client>
+}