From 40598cb7bfeb6b1042482fe91701770b179c1803 Mon Sep 17 00:00:00 2001 From: Chris Alfonso Date: Mon, 7 Jul 2008 17:20:43 -0400 Subject: Renaming everying everest to genome --- genome-bootstrap/test/data/test_main_page.html | 56 ++++++++++++++++++++++++++ genome-bootstrap/test/test_genome-bootstrap.rb | 53 ++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 genome-bootstrap/test/data/test_main_page.html create mode 100644 genome-bootstrap/test/test_genome-bootstrap.rb (limited to 'genome-bootstrap/test') diff --git a/genome-bootstrap/test/data/test_main_page.html b/genome-bootstrap/test/data/test_main_page.html new file mode 100644 index 0000000..fdbd6e3 --- /dev/null +++ b/genome-bootstrap/test/data/test_main_page.html @@ -0,0 +1,56 @@ + + + + +Welcome, bleanhar
Add New Host
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
usernamesystemdomainlast_updateaddresshashCommands
bleanhar
qax1
usersys.redhat.com
Mon,  7 Jan 2008 08:34:44 -0500
10.11.227.175
eca4216529d7c1ee7dc5e062dcc1fd4e
Delete
bleanhar
qax
usersys.redhat.com
Fri, 29 Jun 2007 09:02:56 -0400
10.11.227.175
qax2881b
Delete
bleanhar
it-selenium
usersys.redhat.com
Mon, 21 Jan 2008 14:34:43 -0500
10.11.227.99
21ecb1fbdd80bbd1cbb9847ec5157611
Delete
bleanhar
bleanhar-repo
usersys.redhat.com
Mon,  4 Feb 2008 10:43:45 -0500
10.11.227.33
00179312758b35efcff9d60058a74b14
Delete
bleanhar
genome-repo
usersys.redhat.com
Mon, 18 Feb 2008 14:37:30 -0500
10.11.227.66
8dd6d6855724d2f306242d3b60fc2d98
Delete
bleanhar
bleanhar-web-services
usersys.redhat.com
Wed, 30 Jan 2008 16:54:34 -0500
10.11.227.69
37f34de7f8e222bb8e44a75401cb5a71
Delete
bleanhar
bleanhar2-repo
usersys.redhat.com
Thu, 14 Feb 2008 08:29:08 -0500
10.11.227.109
7d4a7ff74ee634b82be40e97f811b33f
Delete
bleanhar
bleanhar-laptop
usersys.redhat.com
Thu, 24 Jan 2008 17:40:06 -0500
10.11.227.147
97309b1effc757d46aaf45c80e37a43c
Delete
bleanhar
runlevelzero
usersys.redhat.com
Fri, 15 Feb 2008 08:17:39 -0500
10.11.227.161
5f1b3d3032c462e87804b2b563ec4470
Delete
bleanhar
bleanhar-web-build
usersys.redhat.com
Fri, 15 Feb 2008 08:17:39 -0500
10.11.227.161
779b7847f26c9f3a7e6e4a57b9c86bf2
Delete
bleanhar
bleanhar-web-apps
usersys.redhat.com
Fri, 25 Jan 2008 10:14:37 -0500
10.11.227.97
8115f542be5173cac82a6eca4990c5ee
Delete
bleanhar
bleanhar-web-proxy
usersys.redhat.com
Wed,  6 Feb 2008 08:49:30 -0500
10.11.227.33
b3ca867871bba086a4d7f5dcab09c3be
Delete
bleanhar
bleanhar-jboss-mysql
usersys.redhat.com
Thu, 20 Dec 2007 16:55:01 -0500
10.11.227.39
bleanhar-jboss-mysql24c50
Delete
bleanhar
training-web-proxy
usersys.redhat.com
Thu, 31 Jan 2008 17:14:36 -0500
10.11.227.197
8727cac6206802d16800545fe2449e84
Delete
bleanhar
ib
usersys.redhat.com
Wed,  9 Jan 2008 10:45:03 -0500
10.11.227.145
2e831a400a0ba2c47965052848c25b43
Delete
bleanhar
bleanhar-build
usersys.redhat.com
Thu, 14 Feb 2008 14:59:08 -0500
10.11.227.171
6e557e9d171132c1a519892813f997e2
Delete
bleanhar
bleanhar2-build
usersys.redhat.com
Tue, 12 Feb 2008 17:36:56 -0500
10.11.227.47
3bd7de9ee626b5962f62751e2e8e57d7
Delete
bleanhar
archteam-host
usersys.redhat.com
Tue, 12 Feb 2008 04:23:10 -0500
10.11.227.193
c2bb389019debccef0a3a92d9e263bf8
Delete
bleanhar
genome-cobbler
usersys.redhat.com
Sun, 20 Jan 2008 14:04:18 -0500
10.11.227.74
3c4330d39910d9464cea69ee9a5e0ccd
Delete
bleanhar
bleanhar-cobbler
usersys.redhat.com
Thu, 10 Jan 2008 13:35:06 -0500
10.11.227.154
b5c3c86b5ef815060a202c6ff222bb08
Delete
bleanhar
bleanhar-genome-host
usersys.redhat.com
Wed, 31 Dec 1969 19:00:00 -0500
471cd9c3a92c3740fb69d420dbf803d5
Delete
bleanhar
bleanhar-test-repo
usersys.redhat.com
Wed, 31 Dec 1969 19:00:00 -0500
9dbe5d14fd568de4c3c2aae20cd6a9e2
Delete
bleanhar
bleanhar-host
usersys.redhat.com
Mon, 18 Feb 2008 14:38:49 -0500
10.11.227.167
e388be48b4c8a8acadbf5ad02c9a3658
Delete
bleanhar
genome2-repo
usersys.redhat.com
Tue, 12 Feb 2008 09:04:19 -0500
10.11.227.30
077d9f88ce6ac4984088e200b8d68fd0
Delete
bleanhar
genome2-cobbler
usersys.redhat.com
Wed,  9 Jan 2008 15:53:42 -0500
10.11.227.74
ab38d0aa051ec9fe7cb2dd74ad739f11
Delete
bleanhar
bleanhar2-web-build
usersys.redhat.com
Mon, 18 Feb 2008 14:37:28 -0500
10.11.227.61
0b86602317ca436486f24ebf3a1c6cc4
Delete
bleanhar
bleanhar2-web-proxy
usersys.redhat.com
Fri, 18 Jan 2008 16:54:27 -0500
10.11.227.42
fa11ebbdcbbd5097103ffff975f281df
Delete
bleanhar
arch-repo
usersys.redhat.com
Mon, 18 Feb 2008 14:38:49 -0500
10.11.227.59
7816d5dfd412876a16be64b507ee46ce
Delete
bleanhar
genome2-build
usersys.redhat.com
Tue,  5 Feb 2008 15:39:01 -0500
10.11.227.42
d5ec4bc119dc61964054bc5442697e8f
Delete
bleanhar
bleanharTest-repo
usersys.redhat.com
Tue, 15 Jan 2008 12:25:03 -0500
10.11.227.37
59116ec1aff8677c3597e603e0089ba5
Delete
bleanhar
archRepo-repo
usersys.redhat.com
Mon, 21 Jan 2008 12:09:31 -0500
10.11.227.187
f2cef863697288f8918eee9020dc4f3f
Delete
bleanhar
bleanhar2-web-apps
usersys.redhat.com
Fri, 18 Jan 2008 16:54:27 -0500
10.11.227.184
4c86ee566167ef59c1d27501121c7db8
Delete
bleanhar
bleanhar2-web-services
usersys.redhat.com
Fri, 18 Jan 2008 16:54:26 -0500
10.11.227.136
6efb00f35b0968c8fcf5fbc8f700766d
Delete
bleanhar
test-host
usersys.redhat.com
Wed, 31 Dec 1969 19:00:00 -0500
1e9f6ea8ad24030198e59527b8980b38
Delete
bleanhar
bleanhar-pc2-web-apps
usersys.redhat.com
Fri, 25 Jan 2008 15:49:07 -0500
10.11.227.11
7d32ce18b7d39be5d4656af1cb7e1994
Delete
bleanhar
bleanhar-pc2-web-services
usersys.redhat.com
Fri, 25 Jan 2008 15:49:07 -0500
10.11.227.14
3f3e6cb856942827c8b6334c09757375
Delete
bleanhar
bleanhar-pc2-web-proxy
usersys.redhat.com
Fri, 25 Jan 2008 15:49:07 -0500
10.11.227.169
31fb38651780068aa04545bc80adfe71
Delete
bleanhar
test-web-proxy
usersys.redhat.com
Mon, 28 Jan 2008 19:44:16 -0500
10.11.227.194
7384539a9784c6e162ce0638377bc0e1
Delete
bleanhar
bleanhar2-jboss
usersys.redhat.com
Mon, 11 Feb 2008 08:33:50 -0500
10.11.227.65
6aacf7ff55f6e9e6c2b5d7a62362992d
Delete
bleanhar
training-repo
usersys.redhat.com
Tue,  5 Feb 2008 10:29:29 -0500
10.11.227.130
f700f65b34bd83da432b12e2dafa3795
Delete
bleanhar
bleanhar1-selenium-queue
usersys.redhat.com
Thu,  7 Feb 2008 14:49:26 -0500
10.11.227.69
7736926d2b33fcc98bd2858f75924014
Delete
bleanhar
bleanhar-hudson
usersys.redhat.com
Wed, 30 Jan 2008 19:29:36 -0500
10.11.227.97
ccafb2ffba93b5f0c20673b170b3d262
Delete
bleanhar
training-host
usersys.redhat.com
Fri,  1 Feb 2008 09:41:18 -0500
10.11.227.29
72b2541418156a3435b14551348dd463
Delete
bleanhar
training-hudson
usersys.redhat.com
Fri,  1 Feb 2008 09:41:19 -0500
10.11.227.165
7d3beb272ec5afb408d0e689820f0cb2
Delete
bleanhar
colgate-host
usersys.redhat.com
Mon, 18 Feb 2008 14:36:44 -0500
10.11.226.201
97f50f1569a44e07335738aede7a5db8
Delete
bleanhar
bleanhar1-rq
usersys.redhat.com
Wed, 31 Dec 1969 19:00:00 -0500
99c649639e22c22fbe235c17ba0c7f28
Delete
bleanhar
bleanhar1-web-build
usersys.redhat.com
Thu,  7 Feb 2008 14:44:32 -0500
10.11.227.145
cc83321aab54eafa2fe6119be4a4897f
Delete
bleanhar
genome-staging-repo
usersys.redhat.com
Mon, 18 Feb 2008 14:38:48 -0500
10.11.227.42
4837e70d1c38bbd3649bf090723fecdb
Delete
bleanhar
bleanhar-ldap
usersys.redhat.com
Thu, 14 Feb 2008 08:29:09 -0500
10.11.227.42
d6f3fc74e836656f1a6c355667d2afb8
Delete
+ diff --git a/genome-bootstrap/test/test_genome-bootstrap.rb b/genome-bootstrap/test/test_genome-bootstrap.rb new file mode 100644 index 0000000..616d6a4 --- /dev/null +++ b/genome-bootstrap/test/test_genome-bootstrap.rb @@ -0,0 +1,53 @@ +# Copyright (C) 2008 Red Hat, Inc + +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# a long with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require 'genome-bootstrap/ddns' +require 'rubygems' +require 'mocha' + +class TestDDNS < Test::Unit::TestCase + def setup + @test_main_page = File.read(File.dirname(__FILE__) + "/data/test_main_page.html") + end + + def mkddns(hostname) + RedHatDDNS::DDNS.new("fakeuser", "fakepass", hostname) + end + + def test_exact_match_exists + ddns = mkddns("bleanhar-jboss-mysql") + ddns.expects(:main_page).yields(@test_main_page) + ddns.expects(:request_new_hash).never + assert_equal("bleanhar-jboss-mysql24c50", ddns.ddns_hash) + end + + def test_hostnames_in_reverse_alphabetical_order + ddns = mkddns("qax") + ddns.expects(:main_page).yields(@test_main_page) + ddns.expects(:request_new_hash).never + assert_equal("qax2881b", ddns.ddns_hash) + end + + def test_exact_match_doesnt_exist_but_a_superset_does + ddns = mkddns("bleanhar-jboss") + ddns.stubs(:main_page).yields(@test_main_page) + ddns.expects(:request_new_hash).times(3) # This is the default number of tries + + assert_raise RuntimeError do + ddns.ddns_hash + end + end +end -- cgit