_bug004 >> _bug006 >> _bug016 >> _bug015 >> _bug013 

TB Wiki

Login

TestMacroSiteStatus in 'raw' format

== SiteStatus macro test =
Here are some tests for the SiteStatus Macro.

== Numeric Address test ==
Test a numeric network address, using:

{''''''{SiteStatus(8.8.8.8)}}

Expected: UP

Got: {{SiteStatus(8.8.8.8)}}

== Domain name test ==
Test a domain name for a machine, using:

Test a numeric network address, using:

{''''''{SiteStatus(birdcloud.org)}}

Expected: UP

Got: {{SiteStatus(birdcloud.org)}}

== Web URL test ==


== Custom result strings test ==
Test that the macro can return custom result strings, using:

=== Test up_str ===
{''''''{SiteStatus(ht''''''tps://birdcloud.org/,1,0)}}

Expected: 1

Got: {{SiteStatus(https://birdcloud.org/,1,0)}}

----

=== Test down_str ===
{''''''{SiteStatus(ht''''''tps://birdcloud.org/bogus-url,1,0)}}

Expected: 0

Got: {{SiteStatus(https://birdcloud.org/bogus-url,1,0)}}

== Test non-existent URL ==
Test URL that doesn't exist, with:
{''''''{SiteStatus(ht''''''tps://birdcloud-bogus.org/)}}

Expected: {{html_error(Exception getting site status (for 'https://birdcloud-bogus.org/'): [Errno socket error] [Errno -2] Name or service not known)}}

Got: {{SiteStatus(https://birdcloud-bogus.org/)}}
TBWiki engine 1.9.3 by Tim Bird