require 'test/unit'
require 'rubygems'
require 'mocha'
KYTOON_PROJECT = "#{File.dirname(__FILE__)}" unless defined?(KYTOON_PROJECT)
$:.unshift File.dirname(__FILE__) + '/../lib'
require 'kytoon'
require 'tempfile'
require 'fileutils'
class TmpDir
def self.new_tmp_dir(prefix="kytoon")
tmp_file=Tempfile.new prefix
path=tmp_file.path
tmp_file.close(true)
FileUtils.mkdir_p path
return path
end
end
SERVER_GROUP_XML = %{
2010-10-15T15:15:58-04:00
test description
mydomain.net
false
1759
172.19.0.2
test
dan.prince
2010-10-15T15:15:58-04:00
3
172.19.0.0
255.255.128.0
3
1
2010-10-15T15:15:58-04:00
login1
184.106.205.120
4
false
5513
14
10.179.107.203
login1
true
0
1759
Online
2010-10-15T15:18:22-04:00
3
2
2010-10-15T15:15:58-04:00
test1
184.106.205.121
49
false
5513
49
10.179.107.204
test1
false
0
1759
Online
2010-10-15T15:18:22-04:00
}
CLIENT_XML = %{
2011-01-09T19:37:32-05:00
Toolkit Client: local
5
false
local
11
Online
2011-01-09T19:37:37-05:00
-----BEGIN CERTIFICATE-----
MIIDyDCCAzGgAwIBAgIJAORNZNRpPx87MA0GCSqGSIb3DQEBBQUAMIGfMQswCQYD
VQQGEwJVUzELMAkGA1UECBMCVkExEzARBgNVBAcTCkJsYWNrc2J1cmcxEjAQBgNV
BAoTCVJhY2tzcGFjZTEXMBUGA1UECxMOSW5mcmFzdHJ1Y3R1cmUxDjAMBgNVBAMT
BWxvZ2luMQ4wDAYDVQQpEwVsb2dpbjEhMB8GCSqGSIb3DQEJARYSY29icmFAc25h
a2VvaWwuY29tMB4XDTExMDExMDAwMzI1NVoXDTIxMDEwNzAwMzI1NVowgZ8xCzAJ
BgNVBAYTAlVTMQswCQYDVQQIEwJWQTETMBEGA1UEBxMKQmxhY2tzYnVyZzESMBAG
A1UEChMJUmFja3NwYWNlMRcwFQYDVQQLEw5JbmZyYXN0cnVjdHVyZTEOMAwGA1UE
AxMFbG9naW4xDjAMBgNVBCkTBWx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GXnc6INX5s1AxJ3mvp4o6PQ7ytP4v/QkJ
ZVMgWV8immfa3PboFgT00qqpbC2Vbf4RR972IEQfGuJLLl4YLrJsbloV9hBamKS7
Z1lllmEHxFWpNK2FLSZNaeQABZyvzfZYkk6zsHoY8XsCBg==
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQCefsUr0T4oQUjKjW7Dpx0tKwwafBF2HUW7CI75apeTjSBgYC1C
HC6cggfFkUTFvndzspbGaeuJeYtvcvkAa2BDp4jlSJgEXa+Uy1UAj1y06BePLNbK
F4EfgEGf3eIWcdOtLYbOg4k33uNgto168iVOowWOR+B2/z73NIHWxvtF3wIDAQAB
AoGAf3tFykWl8ij4jHsP8Wz0CcWLGa5bOR64XIS4wyKaQoML3JjfLkKOtzHbYGzE
3Syi1bt6jKLbYZsSrRTT9SNorB3M2HI/uu1NHVyJ8fqxSJs9wQWv26XcMq6iPXR6
JQmiG44r0NoHtDOw0NCoo+9il4wjTIVSwN58x69EO1hsWokCQQDREYW73F536KzN
GSsLy+8VsaRiHCboi7lZwITGt4xFhykP/P5R/mNMTklVpJENuZH5jhiBr8r2O/XE
NQpIEZiFAkEAwhL4EnXax5p50g2CpkJM2B9F/p3IjjMs/sdUh4/RvAVkVAzz7uOh
TjtrL0T6480wA7rk3324IG5x4XTgXYVkEwJBAKkg7LgJ0N5d+xS8TIdxhctd9uZr
ccpj5iDGTmNXbwF8EurdNnvsODYtisPeqn2Y5o8ktYyMQrupy+rbIaMloOUCQAsI
pQ33oV6jy7VDi2AEePX4oTQeqF5dTnuVvZqPdK8p51BYBC5axrr56dggJdt5uPcd
UxHZxfQiE1tsF615ff0CQQCjeBskODATJkbN0kw+6FIF9m7QoEAYtJD1jLiY/2Sv
QRiYX+gvycrIph1yyIGA1qeHYnjhQp4ZijhcwSFUAAyF
-----END RSA PRIVATE KEY-----
2011-01-09T19:37:32-05:00
15
5
Client
172.19.0.6
2011-01-09T19:37:36-05:00
172.19.0.5
}
SERVER_XML = %{
888
2010-07-29T10:27:33-04:00
blah
123.100.100.100
3
1234
14
10.119.225.116
db1
false
0
999
Online
2010-07-29T11:19:04-04:00
}