First basic tests ;-) Assume that tor is configured and just test if we see the right onion address for our blob
(node_factory)
| 1969 | |
| 1970 | @pytest.mark.developer("needs a running Tor service instance at port 9151 or 9051") |
| 1971 | def test_statictor_onions(node_factory): |
| 1972 | """First basic tests ;-) |
| 1973 | |
| 1974 | Assume that tor is configured and just test |
| 1975 | if we see the right onion address for our blob |
| 1976 | """ |
| 1977 | # please define your values |
| 1978 | torip = '127.0.0.1' |
| 1979 | torips = '127.0.0.1:9051' |
| 1980 | torport = 9050 |
| 1981 | torserviceport = 9051 |
| 1982 | portA, portB = reserve(), reserve() |
| 1983 | |
| 1984 | if not check_socket(format(torip), torserviceport): |
| 1985 | return |
| 1986 | |
| 1987 | if not check_socket(format(torip), torport): |
| 1988 | return |
| 1989 | |
| 1990 | l1 = node_factory.get_node(may_fail=True, options={ |
| 1991 | 'bind-addr': '127.0.0.1:{}'.format(portA), |
| 1992 | 'addr': ['statictor:{}'.format(torips)] |
| 1993 | }) |
| 1994 | l2 = node_factory.get_node(may_fail=True, options={ |
| 1995 | 'bind-addr': '127.0.0.1:{}'.format(portB), |
| 1996 | 'addr': ['statictor:{}/torblob=11234567890123456789012345678901/torport={}'.format(torips, 9736)] |
| 1997 | }) |
| 1998 | |
| 1999 | assert l1.daemon.is_in_log('127.0.0.1:{}'.format(l1.port)) |
| 2000 | # Did not specify torport, so it's the default. |
| 2001 | assert l1.daemon.is_in_log('.onion:{}'.format(default_ln_port(l1.info["network"]))) |
| 2002 | assert l2.daemon.is_in_log('x2y4zvh4fn5q3eouuh7nxnc7zeawrqoutljrup2xjtiyxgx3emgkemad.onion:{},127.0.0.1:{}'.format(9736, l2.port)) |
| 2003 | |
| 2004 | |
| 2005 | @pytest.mark.developer("needs a running Tor service instance at port 9151 or 9051") |
nothing calls this directly
no test coverage detected