TestMacroSiteStatus

SiteStatus macro test [edit section]

Here are some tests for the SiteStatus Macro.

Numeric Address test [edit section]

Test a numeric network address, using:

{{SiteStatus(8.8.8.8)}}

Expected: UP

Got: exception in macro SiteStatus:main

Domain name test [edit section]

Test a domain name for a machine, using:

Test a numeric network address, using:

{{SiteStatus(birdcloud.org)}}

Expected: UP

Got: exception in macro SiteStatus:main

Web URL test [edit section]

Custom result strings test [edit section]

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

Test up_str [edit section]

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

Expected: 1

Got: 1


Test down_str [edit section]

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

Expected: 0

Got: exception in macro SiteStatus:main

Test non-existent URL [edit section]

Test URL that doesn't exist, with: {{SiteStatus(https://birdcloud-bogus.org/)}}

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

Got: exception in macro SiteStatus:main