Don't run LAN unittests on QubesOS

This commit is contained in:
Kevin Froman 2020-08-17 19:02:24 -05:00
parent 0b2658374b
commit 6f242298fe
2 changed files with 10 additions and 0 deletions

View File

@ -17,12 +17,17 @@ from utils import bettersleep
from lan.discover import lan_ips, MCAST_GRP, MCAST_PORT from lan.discover import lan_ips, MCAST_GRP, MCAST_PORT
from lan.discover import learn_services, advertise_service from lan.discover import learn_services, advertise_service
import socket import socket
import logger
from socket import SHUT_RDWR from socket import SHUT_RDWR
from etc import onionrvalues
lan_ips = [''] lan_ips = ['']
class TestLanLearn(unittest.TestCase): class TestLanLearn(unittest.TestCase):
def test_lan_learn(self): def test_lan_learn(self):
if onionrvalues.IS_QUBES:
logger.info('Cannot run LAN tests on Qubes')
return
test_ip = '192.168.1.30' test_ip = '192.168.1.30'
def multicast(): def multicast():
port = 1349 port = 1349

View File

@ -19,11 +19,16 @@ from lan.discover import lan_ips, MCAST_GRP, MCAST_PORT, IS_ALL_GROUPS
from lan.discover import advertise_service from lan.discover import advertise_service
import socket import socket
from socket import SHUT_RDWR from socket import SHUT_RDWR
import logger
from etc import onionrvalues
class TestLanLearn(unittest.TestCase): class TestLanLearn(unittest.TestCase):
def test_lan_broadcast(self): def test_lan_broadcast(self):
test_ip = '192.168.1.30' test_ip = '192.168.1.30'
if onionrvalues.IS_QUBES:
logger.info('Cannot run LAN tests on Qubes')
return
def multicast(): def multicast():
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)