summaryrefslogtreecommitdiffstats
path: root/genome-bootstrap/test
diff options
context:
space:
mode:
authorChris Alfonso <calfonso@redhat.com>2008-07-07 17:20:43 -0400
committerChris Alfonso <calfonso@redhat.com>2008-07-08 10:43:59 -0400
commit40598cb7bfeb6b1042482fe91701770b179c1803 (patch)
tree57d9b019a845fbcf4a7fcb8ccbce836bfc45174c /genome-bootstrap/test
parent9b9d481f6684777e90bb144193251244d14926ae (diff)
downloadtools-40598cb7bfeb6b1042482fe91701770b179c1803.tar.gz
tools-40598cb7bfeb6b1042482fe91701770b179c1803.tar.xz
tools-40598cb7bfeb6b1042482fe91701770b179c1803.zip
Renaming everying everest to genome
Diffstat (limited to 'genome-bootstrap/test')
-rw-r--r--genome-bootstrap/test/data/test_main_page.html56
-rw-r--r--genome-bootstrap/test/test_genome-bootstrap.rb53
2 files changed, 109 insertions, 0 deletions
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 @@
+<html>
+<body>
+
+
+Welcome, bleanhar<br><a href="add.php">Add New Host</a><br><table border=1 ><tr><th><a href=?sort=username&hostname=&username=>username</a></th><th><a href=?sort=system&hostname=&username=>system</a></th><th><a href=?sort=domain&hostname=&username=>domain</a></th><th><a href=?sort=last_update&hostname=&username=>last_update</a></th><th><a href=?sort=address&hostname=&username=>address</a></th><th><a href=?sort=hash&hostname=&username=>hash</a></th><th>Commands</th></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>qax1</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Mon, 7 Jan 2008 08:34:44 -0500</pre></td><td><pre>10.11.227.175</pre></td><td><pre>eca4216529d7c1ee7dc5e062dcc1fd4e</pre></td><td><a href="delete.php?hash=eca4216529d7c1ee7dc5e062dcc1fd4e">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>qax</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Fri, 29 Jun 2007 09:02:56 -0400</pre></td><td><pre>10.11.227.175</pre></td><td><pre>qax2881b</pre></td><td><a href="delete.php?hash=qax2881b">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>it-selenium</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Mon, 21 Jan 2008 14:34:43 -0500</pre></td><td><pre>10.11.227.99</pre></td><td><pre>21ecb1fbdd80bbd1cbb9847ec5157611</pre></td><td><a href="delete.php?hash=21ecb1fbdd80bbd1cbb9847ec5157611">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-repo</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Mon, 4 Feb 2008 10:43:45 -0500</pre></td><td><pre>10.11.227.33</pre></td><td><pre>00179312758b35efcff9d60058a74b14</pre></td><td><a href="delete.php?hash=00179312758b35efcff9d60058a74b14">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>genome-repo</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Mon, 18 Feb 2008 14:37:30 -0500</pre></td><td><pre>10.11.227.66</pre></td><td><pre>8dd6d6855724d2f306242d3b60fc2d98</pre></td><td><a href="delete.php?hash=8dd6d6855724d2f306242d3b60fc2d98">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-web-services</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Wed, 30 Jan 2008 16:54:34 -0500</pre></td><td><pre>10.11.227.69</pre></td><td><pre>37f34de7f8e222bb8e44a75401cb5a71</pre></td><td><a href="delete.php?hash=37f34de7f8e222bb8e44a75401cb5a71">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar2-repo</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Thu, 14 Feb 2008 08:29:08 -0500</pre></td><td><pre>10.11.227.109</pre></td><td><pre>7d4a7ff74ee634b82be40e97f811b33f</pre></td><td><a href="delete.php?hash=7d4a7ff74ee634b82be40e97f811b33f">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-laptop</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Thu, 24 Jan 2008 17:40:06 -0500</pre></td><td><pre>10.11.227.147</pre></td><td><pre>97309b1effc757d46aaf45c80e37a43c</pre></td><td><a href="delete.php?hash=97309b1effc757d46aaf45c80e37a43c">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>runlevelzero</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Fri, 15 Feb 2008 08:17:39 -0500</pre></td><td><pre>10.11.227.161</pre></td><td><pre>5f1b3d3032c462e87804b2b563ec4470</pre></td><td><a href="delete.php?hash=5f1b3d3032c462e87804b2b563ec4470">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-web-build</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Fri, 15 Feb 2008 08:17:39 -0500</pre></td><td><pre>10.11.227.161</pre></td><td><pre>779b7847f26c9f3a7e6e4a57b9c86bf2</pre></td><td><a href="delete.php?hash=779b7847f26c9f3a7e6e4a57b9c86bf2">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-web-apps</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Fri, 25 Jan 2008 10:14:37 -0500</pre></td><td><pre>10.11.227.97</pre></td><td><pre>8115f542be5173cac82a6eca4990c5ee</pre></td><td><a href="delete.php?hash=8115f542be5173cac82a6eca4990c5ee">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-web-proxy</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Wed, 6 Feb 2008 08:49:30 -0500</pre></td><td><pre>10.11.227.33</pre></td><td><pre>b3ca867871bba086a4d7f5dcab09c3be</pre></td><td><a href="delete.php?hash=b3ca867871bba086a4d7f5dcab09c3be">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-jboss-mysql</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Thu, 20 Dec 2007 16:55:01 -0500</pre></td><td><pre>10.11.227.39</pre></td><td><pre>bleanhar-jboss-mysql24c50</pre></td><td><a href="delete.php?hash=bleanhar-jboss-mysql24c50">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>training-web-proxy</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Thu, 31 Jan 2008 17:14:36 -0500</pre></td><td><pre>10.11.227.197</pre></td><td><pre>8727cac6206802d16800545fe2449e84</pre></td><td><a href="delete.php?hash=8727cac6206802d16800545fe2449e84">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>ib</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Wed, 9 Jan 2008 10:45:03 -0500</pre></td><td><pre>10.11.227.145</pre></td><td><pre>2e831a400a0ba2c47965052848c25b43</pre></td><td><a href="delete.php?hash=2e831a400a0ba2c47965052848c25b43">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-build</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Thu, 14 Feb 2008 14:59:08 -0500</pre></td><td><pre>10.11.227.171</pre></td><td><pre>6e557e9d171132c1a519892813f997e2</pre></td><td><a href="delete.php?hash=6e557e9d171132c1a519892813f997e2">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar2-build</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Tue, 12 Feb 2008 17:36:56 -0500</pre></td><td><pre>10.11.227.47</pre></td><td><pre>3bd7de9ee626b5962f62751e2e8e57d7</pre></td><td><a href="delete.php?hash=3bd7de9ee626b5962f62751e2e8e57d7">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>archteam-host</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Tue, 12 Feb 2008 04:23:10 -0500</pre></td><td><pre>10.11.227.193</pre></td><td><pre>c2bb389019debccef0a3a92d9e263bf8</pre></td><td><a href="delete.php?hash=c2bb389019debccef0a3a92d9e263bf8">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>genome-cobbler</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Sun, 20 Jan 2008 14:04:18 -0500</pre></td><td><pre>10.11.227.74</pre></td><td><pre>3c4330d39910d9464cea69ee9a5e0ccd</pre></td><td><a href="delete.php?hash=3c4330d39910d9464cea69ee9a5e0ccd">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-cobbler</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Thu, 10 Jan 2008 13:35:06 -0500</pre></td><td><pre>10.11.227.154</pre></td><td><pre>b5c3c86b5ef815060a202c6ff222bb08</pre></td><td><a href="delete.php?hash=b5c3c86b5ef815060a202c6ff222bb08">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-genome-host</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Wed, 31 Dec 1969 19:00:00 -0500</pre></td><td><pre></pre></td><td><pre>471cd9c3a92c3740fb69d420dbf803d5</pre></td><td><a href="delete.php?hash=471cd9c3a92c3740fb69d420dbf803d5">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-test-repo</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Wed, 31 Dec 1969 19:00:00 -0500</pre></td><td><pre></pre></td><td><pre>9dbe5d14fd568de4c3c2aae20cd6a9e2</pre></td><td><a href="delete.php?hash=9dbe5d14fd568de4c3c2aae20cd6a9e2">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-host</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Mon, 18 Feb 2008 14:38:49 -0500</pre></td><td><pre>10.11.227.167</pre></td><td><pre>e388be48b4c8a8acadbf5ad02c9a3658</pre></td><td><a href="delete.php?hash=e388be48b4c8a8acadbf5ad02c9a3658">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>genome2-repo</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Tue, 12 Feb 2008 09:04:19 -0500</pre></td><td><pre>10.11.227.30</pre></td><td><pre>077d9f88ce6ac4984088e200b8d68fd0</pre></td><td><a href="delete.php?hash=077d9f88ce6ac4984088e200b8d68fd0">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>genome2-cobbler</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Wed, 9 Jan 2008 15:53:42 -0500</pre></td><td><pre>10.11.227.74</pre></td><td><pre>ab38d0aa051ec9fe7cb2dd74ad739f11</pre></td><td><a href="delete.php?hash=ab38d0aa051ec9fe7cb2dd74ad739f11">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar2-web-build</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Mon, 18 Feb 2008 14:37:28 -0500</pre></td><td><pre>10.11.227.61</pre></td><td><pre>0b86602317ca436486f24ebf3a1c6cc4</pre></td><td><a href="delete.php?hash=0b86602317ca436486f24ebf3a1c6cc4">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar2-web-proxy</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Fri, 18 Jan 2008 16:54:27 -0500</pre></td><td><pre>10.11.227.42</pre></td><td><pre>fa11ebbdcbbd5097103ffff975f281df</pre></td><td><a href="delete.php?hash=fa11ebbdcbbd5097103ffff975f281df">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>arch-repo</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Mon, 18 Feb 2008 14:38:49 -0500</pre></td><td><pre>10.11.227.59</pre></td><td><pre>7816d5dfd412876a16be64b507ee46ce</pre></td><td><a href="delete.php?hash=7816d5dfd412876a16be64b507ee46ce">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>genome2-build</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Tue, 5 Feb 2008 15:39:01 -0500</pre></td><td><pre>10.11.227.42</pre></td><td><pre>d5ec4bc119dc61964054bc5442697e8f</pre></td><td><a href="delete.php?hash=d5ec4bc119dc61964054bc5442697e8f">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanharTest-repo</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Tue, 15 Jan 2008 12:25:03 -0500</pre></td><td><pre>10.11.227.37</pre></td><td><pre>59116ec1aff8677c3597e603e0089ba5</pre></td><td><a href="delete.php?hash=59116ec1aff8677c3597e603e0089ba5">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>archRepo-repo</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Mon, 21 Jan 2008 12:09:31 -0500</pre></td><td><pre>10.11.227.187</pre></td><td><pre>f2cef863697288f8918eee9020dc4f3f</pre></td><td><a href="delete.php?hash=f2cef863697288f8918eee9020dc4f3f">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar2-web-apps</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Fri, 18 Jan 2008 16:54:27 -0500</pre></td><td><pre>10.11.227.184</pre></td><td><pre>4c86ee566167ef59c1d27501121c7db8</pre></td><td><a href="delete.php?hash=4c86ee566167ef59c1d27501121c7db8">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar2-web-services</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Fri, 18 Jan 2008 16:54:26 -0500</pre></td><td><pre>10.11.227.136</pre></td><td><pre>6efb00f35b0968c8fcf5fbc8f700766d</pre></td><td><a href="delete.php?hash=6efb00f35b0968c8fcf5fbc8f700766d">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>test-host</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Wed, 31 Dec 1969 19:00:00 -0500</pre></td><td><pre></pre></td><td><pre>1e9f6ea8ad24030198e59527b8980b38</pre></td><td><a href="delete.php?hash=1e9f6ea8ad24030198e59527b8980b38">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-pc2-web-apps</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Fri, 25 Jan 2008 15:49:07 -0500</pre></td><td><pre>10.11.227.11</pre></td><td><pre>7d32ce18b7d39be5d4656af1cb7e1994</pre></td><td><a href="delete.php?hash=7d32ce18b7d39be5d4656af1cb7e1994">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-pc2-web-services</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Fri, 25 Jan 2008 15:49:07 -0500</pre></td><td><pre>10.11.227.14</pre></td><td><pre>3f3e6cb856942827c8b6334c09757375</pre></td><td><a href="delete.php?hash=3f3e6cb856942827c8b6334c09757375">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-pc2-web-proxy</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Fri, 25 Jan 2008 15:49:07 -0500</pre></td><td><pre>10.11.227.169</pre></td><td><pre>31fb38651780068aa04545bc80adfe71</pre></td><td><a href="delete.php?hash=31fb38651780068aa04545bc80adfe71">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>test-web-proxy</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Mon, 28 Jan 2008 19:44:16 -0500</pre></td><td><pre>10.11.227.194</pre></td><td><pre>7384539a9784c6e162ce0638377bc0e1</pre></td><td><a href="delete.php?hash=7384539a9784c6e162ce0638377bc0e1">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar2-jboss</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Mon, 11 Feb 2008 08:33:50 -0500</pre></td><td><pre>10.11.227.65</pre></td><td><pre>6aacf7ff55f6e9e6c2b5d7a62362992d</pre></td><td><a href="delete.php?hash=6aacf7ff55f6e9e6c2b5d7a62362992d">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>training-repo</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Tue, 5 Feb 2008 10:29:29 -0500</pre></td><td><pre>10.11.227.130</pre></td><td><pre>f700f65b34bd83da432b12e2dafa3795</pre></td><td><a href="delete.php?hash=f700f65b34bd83da432b12e2dafa3795">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar1-selenium-queue</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Thu, 7 Feb 2008 14:49:26 -0500</pre></td><td><pre>10.11.227.69</pre></td><td><pre>7736926d2b33fcc98bd2858f75924014</pre></td><td><a href="delete.php?hash=7736926d2b33fcc98bd2858f75924014">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-hudson</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Wed, 30 Jan 2008 19:29:36 -0500</pre></td><td><pre>10.11.227.97</pre></td><td><pre>ccafb2ffba93b5f0c20673b170b3d262</pre></td><td><a href="delete.php?hash=ccafb2ffba93b5f0c20673b170b3d262">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>training-host</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Fri, 1 Feb 2008 09:41:18 -0500</pre></td><td><pre>10.11.227.29</pre></td><td><pre>72b2541418156a3435b14551348dd463</pre></td><td><a href="delete.php?hash=72b2541418156a3435b14551348dd463">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>training-hudson</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Fri, 1 Feb 2008 09:41:19 -0500</pre></td><td><pre>10.11.227.165</pre></td><td><pre>7d3beb272ec5afb408d0e689820f0cb2</pre></td><td><a href="delete.php?hash=7d3beb272ec5afb408d0e689820f0cb2">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>colgate-host</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Mon, 18 Feb 2008 14:36:44 -0500</pre></td><td><pre>10.11.226.201</pre></td><td><pre>97f50f1569a44e07335738aede7a5db8</pre></td><td><a href="delete.php?hash=97f50f1569a44e07335738aede7a5db8">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar1-rq</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Wed, 31 Dec 1969 19:00:00 -0500</pre></td><td><pre></pre></td><td><pre>99c649639e22c22fbe235c17ba0c7f28</pre></td><td><a href="delete.php?hash=99c649639e22c22fbe235c17ba0c7f28">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar1-web-build</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Thu, 7 Feb 2008 14:44:32 -0500</pre></td><td><pre>10.11.227.145</pre></td><td><pre>cc83321aab54eafa2fe6119be4a4897f</pre></td><td><a href="delete.php?hash=cc83321aab54eafa2fe6119be4a4897f">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>genome-staging-repo</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Mon, 18 Feb 2008 14:38:48 -0500</pre></td><td><pre>10.11.227.42</pre></td><td><pre>4837e70d1c38bbd3649bf090723fecdb</pre></td><td><a href="delete.php?hash=4837e70d1c38bbd3649bf090723fecdb">Delete</a></td></tr>
+<tr><td><pre>bleanhar</pre></td><td><pre>bleanhar-ldap</pre></td><td><pre>usersys.redhat.com</pre></td><td><pre>Thu, 14 Feb 2008 08:29:09 -0500</pre></td><td><pre>10.11.227.42</pre></td><td><pre>d6f3fc74e836656f1a6c355667d2afb8</pre></td><td><a href="delete.php?hash=d6f3fc74e836656f1a6c355667d2afb8">Delete</a></td></tr>
+</table></body>
+</html>
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