FrontPage 

TB Wiki

Login

Regression Test

Expected HTML for page "TestMacroSiteStatus"


expected html
nothing
t1<h2><a name="SiteStatus_macro_test">SiteStatus macro test</a>t
2<span align=right class="section_edit_link">[<a href="/tbwiki/TestMacroSiteStatus?action=edit&section=SiteStatus_macro_test">edit section</a>]</font></span>
3</h2>
4Here are some tests for the SiteStatus Macro.
5<p>
6<h2><a name="Numeric_Address_test">Numeric Address test</a>
7<span align=right class="section_edit_link">[<a href="/tbwiki/TestMacroSiteStatus?action=edit&section=Numeric_Address_test">edit section</a>]</font></span>
8</h2>
9Test a numeric network address, using:
10<p>
11{<b></b>{SiteStatus(8.8.8.8)}}
12<p>
13Expected: UP
14<p>
15Got: <font color=red>exception in macro SiteStatus:main</font><p>
16<h2><a name="Domain_name_test">Domain name test</a>
17<span align=right class="section_edit_link">[<a href="/tbwiki/TestMacroSiteStatus?action=edit&section=Domain_name_test">edit section</a>]</font></span>
18</h2>
19Test a domain name for a machine, using:
20<p>
21Test a numeric network address, using:
22<p>
23{<b></b>{SiteStatus(birdcloud.org)}}
24<p>
25Expected: UP
26<p>
27Got: <font color=red>exception in macro SiteStatus:main</font><p>
28<h2><a name="Web_URL_test">Web URL test</a>
29<span align=right class="section_edit_link">[<a href="/tbwiki/TestMacroSiteStatus?action=edit&section=Web_URL_test">edit section</a>]</font></span>
30</h2>
31<p>
32<h2><a name="Custom_result_strings_test">Custom result strings test</a>
33<span align=right class="section_edit_link">[<a href="/tbwiki/TestMacroSiteStatus?action=edit&section=Custom_result_strings_test">edit section</a>]</font></span>
34</h2>
35Test that the macro can return custom result strings, using:
36<p>
37<h3><a name="Test_up_str">Test up_str</a>
38<span align=right class="section_edit_link">[<a href="/tbwiki/TestMacroSiteStatus?action=edit&section=Test_up_str">edit section</a>]</font></span>
39</h3>
40{<b></b>{SiteStatus(ht<b></b>tps://birdcloud.org/,1,0)}}
41<p>
42Expected: 1
43<p>
44Got: 1<p>
45<hr size=2>
46<p>
47<h3><a name="Test_down_str">Test down_str</a>
48<span align=right class="section_edit_link">[<a href="/tbwiki/TestMacroSiteStatus?action=edit&section=Test_down_str">edit section</a>]</font></span>
49</h3>
50{<b></b>{SiteStatus(ht<b></b>tps://birdcloud.org/bogus-url,1,0)}}
51<p>
52Expected: 0
53<p>
54Got: <font color=red>exception in macro SiteStatus:main</font><p>
55<h2><a name="Test_non-existent_URL">Test non-existent URL</a>
56<span align=right class="section_edit_link">[<a href="/tbwiki/TestMacroSiteStatus?action=edit&section=Test_non-existent_URL">edit section</a>]</font></span>
57</h2>
58Test URL that doesn't exist, with:
59{<b></b>{SiteStatus(ht<b></b>tps://birdcloud-bogus.org/)}}
60<p>
61Expected: <font color="red">Exception getting site status (for 'https://birdcloud-bogus.org/'): [Errno socket error] [Errno -2] Name or service not known</font><p>
62Got: <font color=red>exception in macro SiteStatus:main</font>
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op

Differences for page "TestMacroSiteStatus"


expected html
generated html
t No Differences Found t No Differences Found 
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op

Update saved output

Back to diff page

Return to Regression_Test page
exception in macro SiteStatus:main
Traceback (most recent call last):
  File "/home2/birdorg/work/tbwiki-data/tbwiki/plugins/MacroSiteStatus.py", line 70, in main
    return req.html_error("Error getting site status: rcode=%s, stderr=%s" % (rcode, stderr), 0)
TypeError: html_error() takes 1 positional argument but 2 were given

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home2/birdorg/work/tbwiki/cgi-bin/tbwiki_engine.py", line 1998, in call_macro
    html = main_func(req, args)
  File "/home2/birdorg/work/tbwiki-data/tbwiki/plugins/MacroSiteStatus.py", line 79, in main
    return req.html_error("Exception getting site status (for '%s'): %s" % (site, str(e)), False)
TypeError: html_error() takes 1 positional argument but 2 were given


exception in macro SiteStatus:main
Traceback (most recent call last):
  File "/home2/birdorg/work/tbwiki-data/tbwiki/plugins/MacroSiteStatus.py", line 70, in main
    return req.html_error("Error getting site status: rcode=%s, stderr=%s" % (rcode, stderr), 0)
TypeError: html_error() takes 1 positional argument but 2 were given

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home2/birdorg/work/tbwiki/cgi-bin/tbwiki_engine.py", line 1998, in call_macro
    html = main_func(req, args)
  File "/home2/birdorg/work/tbwiki-data/tbwiki/plugins/MacroSiteStatus.py", line 79, in main
    return req.html_error("Exception getting site status (for '%s'): %s" % (site, str(e)), False)
TypeError: html_error() takes 1 positional argument but 2 were given


exception in macro SiteStatus:main
Traceback (most recent call last):
  File "/home2/birdorg/work/tbwiki-data/tbwiki/plugins/MacroSiteStatus.py", line 49, in main
    http_code = urlopen(site, timeout=3).getcode()
  File "/usr/lib64/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python3.9/urllib/request.py", line 523, in open
    response = meth(req, response)
  File "/usr/lib64/python3.9/urllib/request.py", line 632, in http_response
    response = self.parent.error(
  File "/usr/lib64/python3.9/urllib/request.py", line 561, in error
    return self._call_chain(*args)
  File "/usr/lib64/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.9/urllib/request.py", line 641, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home2/birdorg/work/tbwiki/cgi-bin/tbwiki_engine.py", line 1998, in call_macro
    html = main_func(req, args)
  File "/home2/birdorg/work/tbwiki-data/tbwiki/plugins/MacroSiteStatus.py", line 79, in main
    return req.html_error("Exception getting site status (for '%s'): %s" % (site, str(e)), False)
TypeError: html_error() takes 1 positional argument but 2 were given


exception in macro SiteStatus:main
Traceback (most recent call last):
  File "/usr/lib64/python3.9/urllib/request.py", line 1346, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib64/python3.9/http/client.py", line 1285, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib64/python3.9/http/client.py", line 1331, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.9/http/client.py", line 1280, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.9/http/client.py", line 1040, in _send_output
    self.send(msg)
  File "/usr/lib64/python3.9/http/client.py", line 980, in send
    self.connect()
  File "/usr/lib64/python3.9/http/client.py", line 1447, in connect
    super().connect()
  File "/usr/lib64/python3.9/http/client.py", line 946, in connect
    self.sock = self._create_connection(
  File "/usr/lib64/python3.9/socket.py", line 835, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/lib64/python3.9/socket.py", line 966, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home2/birdorg/work/tbwiki-data/tbwiki/plugins/MacroSiteStatus.py", line 49, in main
    http_code = urlopen(site, timeout=3).getcode()
  File "/usr/lib64/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python3.9/urllib/request.py", line 517, in open
    response = self._open(req, data)
  File "/usr/lib64/python3.9/urllib/request.py", line 534, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib64/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.9/urllib/request.py", line 1389, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib64/python3.9/urllib/request.py", line 1349, in do_open
    raise URLError(err)
urllib.error.URLError: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home2/birdorg/work/tbwiki/cgi-bin/tbwiki_engine.py", line 1998, in call_macro
    html = main_func(req, args)
  File "/home2/birdorg/work/tbwiki-data/tbwiki/plugins/MacroSiteStatus.py", line 79, in main
    return req.html_error("Exception getting site status (for '%s'): %s" % (site, str(e)), False)
TypeError: html_error() takes 1 positional argument but 2 were given


TBWiki engine 1.9.3 by Tim Bird